1# Copyright (c) 2025 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/config/components/ets_frontend/ets2abc_config.gni") 15import("//build/ohos.gni") 16import("//foundation/bundlemanager/bundle_framework/appexecfwk.gni") 17 18ohos_shared_library("ani_bundle_manager") { 19 branch_protector_ret = "pac_ret" 20 21 sanitize = { 22 boundary_sanitize = true 23 cfi = true 24 cfi_cross_dso = true 25 debug = false 26 integer_overflow = true 27 ubsan = true 28 } 29 include_dirs = [ 30 "${inner_api_path}/appexecfwk_core/include", 31 "${kits_path}/ani/bundle_manager", 32 "${kits_path}/ani/common", 33 "${kits_path}/js/bundle_manager", 34 "${kits_path}/js/common", 35 ] 36 sources = [ "ani_bundle_manager.cpp" ] 37 38 defines = [ 39 "APP_LOG_TAG = \"BMS\"", 40 "LOG_DOMAIN = 0xD001120", 41 ] 42 43 deps = [ 44 "${base_path}:appexecfwk_base", 45 "${common_path}:libappexecfwk_common", 46 "${core_path}:appexecfwk_core", 47 "${kits_path}/ani/common:bms_ani_common", 48 "${kits_path}/js/bundle_manager:bundle_manager_common", 49 "${kits_path}/js/common:bundle_napi_common", 50 ] 51 52 cflags = [ 53 "-Os", 54 "-fstack-protector-strong", 55 ] 56 57 cflags_cc = [ 58 "-Os", 59 "-fstack-protector-strong", 60 ] 61 62 external_deps = [ 63 "ability_base:want", 64 "ability_runtime:ani_common", 65 "ability_runtime:runtime", 66 "c_utils:utils", 67 "common_event_service:cesfwk_core", 68 "common_event_service:cesfwk_innerkits", 69 "hilog:libhilog", 70 "ipc:ipc_core", 71 "napi:ace_napi", 72 "runtime_core:ani", 73 "runtime_core:ani_helpers", 74 "samgr:samgr_proxy", 75 "ffrt:libffrt", 76 ] 77 78 if (global_resmgr_enable) { 79 defines += [ "GLOBAL_RESMGR_ENABLE" ] 80 } 81 82 subsystem_name = "bundlemanager" 83 part_name = "bundle_framework" 84} 85 86generate_static_abc("bundle_manager") { 87 base_url = "./ets" 88 files = [ "./ets/@ohos.bundle.bundleManager.ets" ] 89 is_boot_abc = "True" 90 device_dst_file = "/system/framework/bundle_manager.abc" 91} 92 93ohos_prebuilt_etc("bundle_manager_etc") { 94 source = "$target_out_dir/bundle_manager.abc" 95 module_install_dir = "framework" 96 subsystem_name = "bundlemanager" 97 part_name = "bundle_framework" 98 deps = [ ":bundle_manager" ] 99} 100 101generate_static_abc("bundle_info") { 102 base_url = "./ets" 103 files = [ 104 "./ets/bundleManager/BundleInfo.ets", 105 "./ets/bundleManager/BundleInfoInner.ets", 106 ] 107 is_boot_abc = "True" 108 device_dst_file = "/system/framework/bundle_info.abc" 109} 110 111ohos_prebuilt_etc("bundle_info_etc") { 112 source = "$target_out_dir/bundle_info.abc" 113 module_install_dir = "framework" 114 subsystem_name = "bundlemanager" 115 part_name = "bundle_framework" 116 deps = [ ":bundle_info" ] 117} 118 119generate_static_abc("application_info") { 120 base_url = "./ets" 121 files = [ 122 "./ets/bundleManager/ApplicationInfo.ets", 123 "./ets/bundleManager/ApplicationInfoInner.ets", 124 ] 125 is_boot_abc = "True" 126 device_dst_file = "/system/framework/application_info.abc" 127 external_dependencies = [ "resource_management:copy_resourceManager_ets" ] 128} 129 130ohos_prebuilt_etc("application_info_etc") { 131 source = "$target_out_dir/application_info.abc" 132 module_install_dir = "framework" 133 subsystem_name = "bundlemanager" 134 part_name = "bundle_framework" 135 deps = [ ":application_info" ] 136} 137 138generate_static_abc("ability_info") { 139 base_url = "./ets" 140 files = [ 141 "./ets/bundleManager/AbilityInfo.ets", 142 "./ets/bundleManager/AbilityInfoInner.ets", 143 ] 144 is_boot_abc = "True" 145 device_dst_file = "/system/framework/ability_info.abc" 146} 147 148ohos_prebuilt_etc("ability_info_etc") { 149 source = "$target_out_dir/ability_info.abc" 150 module_install_dir = "framework" 151 subsystem_name = "bundlemanager" 152 part_name = "bundle_framework" 153 deps = [ ":ability_info" ] 154} 155 156generate_static_abc("extension_ability_info") { 157 base_url = "./ets" 158 files = [ 159 "./ets/bundleManager/ExtensionAbilityInfo.ets", 160 "./ets/bundleManager/ExtensionAbilityInfoInner.ets", 161 ] 162 is_boot_abc = "True" 163 device_dst_file = "/system/framework/extension_ability_info.abc" 164} 165 166ohos_prebuilt_etc("extension_ability_info_etc") { 167 source = "$target_out_dir/extension_ability_info.abc" 168 module_install_dir = "framework" 169 subsystem_name = "bundlemanager" 170 part_name = "bundle_framework" 171 deps = [ ":extension_ability_info" ] 172} 173 174generate_static_abc("hap_module_info") { 175 base_url = "./ets" 176 files = [ 177 "./ets/bundleManager/HapModuleInfo.ets", 178 "./ets/bundleManager/HapModuleInfoInner.ets", 179 ] 180 is_boot_abc = "True" 181 device_dst_file = "/system/framework/hap_module_info.abc" 182} 183 184ohos_prebuilt_etc("hap_module_info_etc") { 185 source = "$target_out_dir/hap_module_info.abc" 186 module_install_dir = "framework" 187 subsystem_name = "bundlemanager" 188 part_name = "bundle_framework" 189 deps = [ ":hap_module_info" ] 190} 191 192generate_static_abc("metadata") { 193 base_url = "./ets" 194 files = [ 195 "./ets/bundleManager/Metadata.ets", 196 "./ets/bundleManager/MetadataInner.ets", 197 ] 198 is_boot_abc = "True" 199 device_dst_file = "/system/framework/metadata.abc" 200} 201 202ohos_prebuilt_etc("metadata_etc") { 203 source = "$target_out_dir/metadata.abc" 204 module_install_dir = "framework" 205 subsystem_name = "bundlemanager" 206 part_name = "bundle_framework" 207 deps = [ ":metadata" ] 208} 209 210generate_static_abc("skill") { 211 base_url = "./ets" 212 files = [ 213 "./ets/bundleManager/Skill.ets", 214 "./ets/bundleManager/SkillInner.ets", 215 ] 216 is_boot_abc = "True" 217 device_dst_file = "/system/framework/skill.abc" 218} 219 220ohos_prebuilt_etc("skill_etc") { 221 source = "$target_out_dir/skill.abc" 222 module_install_dir = "framework" 223 subsystem_name = "bundlemanager" 224 part_name = "bundle_framework" 225 deps = [ ":skill" ] 226} 227 228ohos_copy("copy_bundleManager_ets") { 229 sources = [ 230 "./ets/bundleManager/AbilityInfoInner.ets", 231 "./ets/bundleManager/ApplicationInfoInner.ets", 232 "./ets/bundleManager/ExtensionAbilityInfoInner.ets", 233 ] 234 outputs = [ "$ohos_ets_inner_path/bundleManager/{{source_file_part}}" ] 235 subsystem_name = "bundlemanager" 236 part_name = "bundle_framework" 237} 238