1# Copyright (c) 2020 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. 13import("//build/lite/config/component/lite_component.gni") 14 15config("bundle_config") { 16 defines = [ "OHOS_APPEXECFWK_BMS_BUNDLEMANAGER" ] 17 cflags_cc = [ "-std=c++14" ] 18} 19 20declare_args() { 21 enable_ohos_bundle_manager_service = false 22 enable_ohos_bundle_manager_service_permission = false 23} 24 25if (ohos_kernel_type == "liteos_m") { 26 static_library("bundlems") { 27 sources = [ 28 "src/bundle_map.cpp", 29 "src/bundle_mgr_service.cpp", 30 "src/bundle_mgr_slite_feature.cpp", 31 "src/bundle_util.cpp", 32 "src/gt_bundle_extractor.cpp", 33 "src/gt_bundle_installer.cpp", 34 "src/gt_bundle_manager_service.cpp", 35 "src/gt_bundle_parser.cpp", 36 "src/gt_extractor_util.cpp", 37 ] 38 39 defines = ["JERRY_FOR_IAR_CONFIG"] 40 if (enable_ohos_bundle_manager_service == true) { 41 defines += [ "_MINI_BMS_" ] 42 } 43 44 if (enable_ohos_bundle_manager_service_permission == true) { 45 defines += [ 46 "_MINI_BMS_PERMISSION_", 47 "BC_TRANS_ENABLE", 48 ] 49 } 50 51 deps = [ 52 "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle", 53 "//base/global/resource_management_lite/frameworks/resmgr_lite:global_resmgr", 54 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static", 55 "//build/lite/config/component/cJSON:cjson_static", 56 "//foundation/arkui/ace_engine_lite/frameworks:ace_lite", 57 "//foundation/systemabilitymgr/samgr_lite/samgr:samgr", 58 "//third_party/jerryscript/jerry-core:jerry-core_static" 59 ] 60 61 include_dirs = [ 62 "${appexecfwk_lite_path}/services/bundlemgr_lite/include", 63 "${appexecfwk_lite_path}/interfaces/inner_api/bundlemgr_lite/slite", 64 "${appexecfwk_lite_path}/interfaces/inner_api/bundlemgr_lite", 65 "${appexecfwk_lite_path}/interfaces/kits/bundle_lite/slite", 66 "${appexecfwk_lite_path}/interfaces/kits/bundle_lite", 67 "${appexecfwk_lite_path}/utils/bundle_lite", 68 "${appexecfwk_lite_path}/frameworks/bundle_lite/include", 69 "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite", 70 "//base/startup/init/interfaces/innerkits/include/syspara", 71 "${aafwk_lite_path}/interfaces/kits/ability_lite/slite", 72 "${aafwk_lite_path}/services/abilitymgr_lite/include", 73 "${aafwk_lite_path}/interfaces/inner_api/abilitymgr_lite", 74 "${aafwk_lite_path}/interfaces/kits/ability_lite", 75 "${aafwk_lite_path}/interfaces/kits/want_lite", 76 "${aafwk_lite_path}/frameworks/want_lite/include", 77 "//base/global/resource_management_lite/interfaces/inner_api/include", 78 "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/registry", 79 "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr", 80 "//third_party/jerryscript/jerry-core", 81 "//third_party/jerryscript/jerry-core/api", 82 "//third_party/jerryscript/jerry-core/ecma/base", 83 "//third_party/jerryscript/jerry-core/include", 84 "//third_party/jerryscript/jerry-core/jrt", 85 "//third_party/jerryscript/jerry-core/jmem", 86 "//third_party/jerryscript/jerry-core/lit", 87 "//third_party/cJSON", 88 "//third_party/zlib", 89 "//third_party/zlib/contrib/minizip", 90 "//base/security/permission_lite/interfaces/kits", 91 "//base/security/permission_lite/services/pms/include", 92 "//base/security/appverify/interfaces/innerkits/appverify_lite/include", 93 "//third_party/bounds_checking_function/include", 94 "//commonlibrary/utils_lite/include", 95 "//commonlibrary/utils_lite/memory/include", 96 "include", 97 ] 98 } 99 lite_component("appexecfwk_services_lite") { 100 features = [ ":bundlems" ] 101 } 102} else { 103 shared_library("bundlems") { 104 configs -= [ "//build/lite/config:language_cpp" ] 105 configs += [ ":bundle_config" ] 106 107 cflags = [ 108 "-Wall", 109 "-Wno-format", 110 "-Wno-format-extra-args", 111 ] 112 cflags_cc = cflags 113 114 sources = [ 115 "src/bundle_daemon_client.cpp", 116 "src/bundle_extractor.cpp", 117 "src/bundle_info_creator.cpp", 118 "src/bundle_inner_feature.cpp", 119 "src/bundle_installer.cpp", 120 "src/bundle_manager_service.cpp", 121 "src/bundle_map.cpp", 122 "src/bundle_ms_feature.cpp", 123 "src/bundle_ms_host.cpp", 124 "src/bundle_parser.cpp", 125 "src/bundle_res_transform.cpp", 126 "src/bundle_util.cpp", 127 "src/extractor_util.cpp", 128 "src/hap_sign_verify.cpp", 129 "src/zip_file.cpp", 130 ] 131 include_dirs = [ 132 "//base/global/resource_management_lite/interfaces/inner_api/include", 133 "${aafwk_lite_path}/services/abilitymgr_lite/include", 134 "${aafwk_lite_path}/interfaces/inner_api/abilitymgr_lite", 135 "${aafwk_lite_path}/interfaces/kits/ability_lite", 136 "${aafwk_lite_path}/interfaces/kits/want_lite", 137 "${aafwk_lite_path}/frameworks/want_lite/include", 138 "${appexecfwk_lite_path}/interfaces/inner_api/bundlemgr_lite", 139 "${appexecfwk_lite_path}/frameworks/bundle_lite/include", 140 "${appexecfwk_lite_path}/interfaces/kits/bundle_lite", 141 "${appexecfwk_lite_path}/utils/bundle_lite", 142 "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/registry", 143 "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr", 144 "//third_party/cJSON", 145 "//third_party/zlib", 146 "//third_party/zlib/contrib/minizip", 147 "//base/security/permission_lite/interfaces/kits", 148 "//base/security/permission_lite/services/pms/include", 149 "//base/security/appverify/interfaces/innerkits/appverify_lite/include", 150 "//third_party/bounds_checking_function/include", 151 "//commonlibrary/utils_lite/include", 152 "//commonlibrary/utils_lite/memory", 153 "include", 154 ] 155 156 public_deps = [ 157 "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle", 158 "//base/global/resource_management_lite/frameworks/resmgr_lite:global_resmgr", 159 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 160 "//base/security/appverify/interfaces/innerkits/appverify_lite:verify", 161 "//build/lite/config/component/cJSON:cjson_shared", 162 "//build/lite/config/component/zlib:zlib_shared", 163 "//foundation/systemabilitymgr/samgr_lite/samgr:samgr", 164 ] 165 } 166 lite_component("appexecfwk_services_lite") { 167 features = [ 168 ":bundlems", 169 "tools:bm", 170 "bundle_daemon:bundle_daemon", 171 ] 172 } 173} 174 175generate_notice_file("appexecfwk_services_lite_notice_file") { 176 module_name = "appexecfwk_services_lite" 177 module_source_dir_list = [ 178 "//third_party/cJSON", 179 "//third_party/zlib", 180 "//third_party/bounds_checking_function", 181 ] 182} 183