1# Copyright (c) 2021 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/ohos.gni") 15import("//foundation/appexecfwk/standard/appexecfwk.gni") 16import( 17 "//foundation/appexecfwk/standard/services/bundlemgr/appexecfwk_bundlemgr.gni") 18 19config("bundlemgr_config") { 20 include_dirs = [ 21 "include", 22 "//utils/system/safwk/native/include", 23 ] 24} 25 26config("bundlemgr_common_config") { 27 include_dirs = [ 28 "include", 29 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base/include", 30 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core/include/bundlemgr", 31 "//utils/system/safwk/native/include", 32 "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk/main/cpp/include", 33 "//base/security/appverify/interfaces/innerkits/appverify/include", 34 ] 35 36 defines = [ 37 "APP_LOG_TAG = \"BundleMgrService\"", 38 "LOG_DOMAIN = 0xD001120", 39 ] 40} 41 42config("bundlemgr_parse_config") { 43 include_dirs = [ 44 "//third_party/json/include", 45 "//third_party/zlib/contrib/minizip", 46 "//third_party/zlib", 47 "//utils/native/base/include", 48 ] 49} 50 51bundlemgr_parser_common_config = [ 52 ":bundlemgr_common_config", 53 ":bundlemgr_parse_config", 54] 55 56ohos_source_set("parser_common") { 57 sources = [ 58 "src/base_extractor.cpp", 59 "src/zip_file.cpp", 60 ] 61 62 public_configs = bundlemgr_parser_common_config 63 64 deps = [ 65 "${common_path}:libappexecfwk_common", 66 "//third_party/zlib:libz", 67 "//utils/native/base:utils", 68 ] 69 70 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 71} 72 73ohos_source_set("bundle_parser") { 74 sources = [ 75 "include/bundle_extractor.h", 76 "include/bundle_parser.h", 77 "include/bundle_profile.h", 78 "src/bundle_extractor.cpp", 79 "src/bundle_parser.cpp", 80 "src/bundle_profile.cpp", 81 ] 82 83 public_configs = bundlemgr_parser_common_config 84 cflags = [] 85 if (target_cpu == "arm") { 86 cflags += [ "-DBINDER_IPC_32BIT" ] 87 } 88 deps = [ 89 ":parser_common", 90 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", 91 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core:appexecfwk_core", 92 "${common_path}:libappexecfwk_common", 93 "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk:libpermissionsdk_standard", 94 ] 95 96 external_deps = [ 97 "hiviewdfx_hilog_native:libhilog", 98 "ipc:ipc_core", 99 ] 100} 101 102group("bms_target") { 103 deps = [ 104 ":installs", 105 ":installs.rc", 106 ":libbms", 107 ] 108} 109 110ohos_shared_library("libbms") { 111 visibility = [ 112 "//foundation/*", 113 "//base/*", 114 ] 115 include_dirs = [ 116 "include", 117 "//foundation/aafwk/standard/interfaces/innerkits/want/include/ohos/aafwk/content/", 118 "//foundation/aafwk/standard/interfaces/innerkits/ability_manager/include", 119 "//foundation/distributedschedule/dmsfwk/services/dtbschedmgr/include", 120 "//base/notification/ces_standard/interfaces/innerkits/native/include", 121 "//utils/system/safwk/native/include", 122 "//third_party/jsoncpp/include", 123 ] 124 125 sources = [ 126 "src/bundle_data_mgr.cpp", 127 "src/bundle_data_storage.cpp", 128 "src/bundle_data_storage_database.cpp", 129 "src/bundle_mgr_host_impl.cpp", 130 "src/bundle_mgr_service.cpp", 131 "src/bundle_mgr_service_event_handler.cpp", 132 "src/bundle_scanner.cpp", 133 "src/bundle_status_callback_death_recipient.cpp", 134 "src/kvstore_death_recipient_callback.cpp", 135 "src/module_usage_data_storage.cpp", 136 "src/permission_changed_death_recipient.cpp", 137 "src/system_ability_helper.cpp", 138 ] 139 140 sources += bundle_install_sources 141 142 defines = [ "APP_LOG_TAG = \"BundleMgrService\"" ] 143 144 configs = [ 145 ":bundlemgr_config", 146 ":bundlemgr_common_config", 147 "${libs_path}/libeventhandler:libeventhandler_config", 148 ] 149 cflags = [] 150 if (target_cpu == "arm") { 151 cflags += [ "-DBINDER_IPC_32BIT" ] 152 } 153 deps = [ 154 ":bundle_parser", 155 ":parser_common", 156 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", 157 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core:appexecfwk_core", 158 "${common_path}:libappexecfwk_common", 159 "${libs_path}/libeventhandler:libeventhandler_target", 160 "//base/security/appverify/interfaces/innerkits/appverify:libhapverify", 161 "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk:libpermissionsdk_standard", 162 "//foundation/aafwk/standard/interfaces/innerkits/base:base", 163 "//foundation/aafwk/standard/interfaces/innerkits/want:want", 164 "//foundation/distributeddatamgr/distributeddatamgr/interfaces/innerkits/distributeddata:distributeddata_inner", 165 "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", 166 "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", 167 "//third_party/jsoncpp:jsoncpp", 168 ] 169 170 external_deps = [ 171 "ces_standard:cesfwk_core", 172 "ces_standard:cesfwk_innerkits", 173 "hiviewdfx_hilog_native:libhilog", 174 "ipc:ipc_core", 175 ] 176 177 subsystem_name = "appexecfwk" 178 part_name = "appexecfwk_standard" 179} 180 181ohos_executable("installs") { 182 sources = [ 183 "src/installd/installd_main.cpp", 184 "src/system_ability_helper.cpp", 185 ] 186 187 sources += install_daemon_sources 188 189 defines = [ "APP_LOG_TAG = \"BundleMgrService\"" ] 190 191 configs = [ ":bundlemgr_config" ] 192 cflags = [] 193 if (target_cpu == "arm") { 194 cflags += [ "-DBINDER_IPC_32BIT" ] 195 } 196 deps = [ 197 ":bundle_parser", 198 ":parser_common", 199 "${common_path}:libappexecfwk_common", 200 "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", 201 "//third_party/jsoncpp:jsoncpp", 202 ] 203 204 external_deps = [ 205 "hiviewdfx_hilog_native:libhilog", 206 "ipc:ipc_core", 207 ] 208 209 install_enable = true 210 subsystem_name = "appexecfwk" 211 part_name = "appexecfwk_standard" 212} 213 214ohos_prebuilt_etc("installs.rc") { 215 if (use_musl) { 216 source = "installs.cfg" 217 } else { 218 source = "installs.rc" 219 } 220 relative_install_dir = "init" 221 subsystem_name = "appexecfwk" 222 part_name = "appexecfwk_standard" 223} 224