# Copyright (c) 2025 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/config/components/ets_frontend/ets2abc_config.gni")
import("//build/ohos.gni")
import("//foundation/bundlemanager/bundle_framework/appexecfwk.gni")
ohos_shared_library("ani_bundle_res_manager") {
shlib_type = "ani"
branch_protector_ret = "pac_ret"
sanitize = {
boundary_sanitize = true
cfi = true
cfi_cross_dso = true
debug = false
integer_overflow = true
ubsan = true
}
include_dirs = [
"${inner_api_path}/appexecfwk_core/include",
"${kits_path}/ani/resource_manager",
"${kits_path}/ani/common",
"${kits_path}/js/common",
"${kits_path}/js/bundle_resource",
]
defines = []
external_deps = []
if (bundle_framework_bundle_resource) {
defines += [ "BUNDLE_FRAMEWORK_BUNDLE_RESOURCE" ]
sources = [
"ani_resource_manager.cpp",
"ani_resource_manager_common.cpp",
"ani_resource_manager_drawable_utils.cpp",
]
if (bundle_framework_graphics) {
defines += [ "BUNDLE_FRAMEWORK_GRAPHICS" ]
external_deps += [
"ace_engine:drawable_inner_ani",
"image_framework:image_native",
"resource_management:global_resmgr",
]
}
} else {
sources = [ "ani_resource_manager_unsupport.cpp" ]
}
defines += [
"APP_LOG_TAG = \"BMS\"",
"LOG_DOMAIN = 0xD001120",
]
deps = [
"${base_path}:appexecfwk_base",
"${common_path}:libappexecfwk_common",
"${core_path}:appexecfwk_core",
"${kits_path}/ani/common:bms_ani_common",
"${kits_path}/js/bundle_resource:bundle_res_common",
"${kits_path}/js/common:bundle_napi_common",
]
cflags = [
"-Os",
"-fstack-protector-strong",
]
cflags_cc = [
"-Os",
"-fstack-protector-strong",
]
external_deps += [
"ability_base:want",
"c_utils:utils",
"common_event_service:cesfwk_core",
"common_event_service:cesfwk_innerkits",
"hilog:libhilog",
"ipc:ipc_core",
"libuv:uv",
"napi:ace_napi",
"node:node_header_notice",
"runtime_core:ani",
"runtime_core:ani_helpers",
"samgr:samgr_proxy",
]
subsystem_name = "bundlemanager"
part_name = "bundle_framework"
}
generate_static_abc("bundle_resource_info") {
base_url = "./ets"
files = [
"./ets/bundleManager/BundleResourceInfo.ets",
"./ets/bundleManager/BundleResourceInfoInner.ets",
]
is_boot_abc = "True"
device_dst_file = "/system/framework/bundle_resource_info.abc"
}
ohos_prebuilt_etc("bundle_resource_info_etc") {
source = "$target_out_dir/bundle_resource_info.abc"
module_install_dir = "framework"
subsystem_name = "bundlemanager"
part_name = "bundle_framework"
deps = [ ":bundle_resource_info" ]
}
generate_static_abc("bundle_resource_manager") {
base_url = "./ets"
files = [ "./ets/@ohos.bundle.bundleResourceManager.ets" ]
is_boot_abc = "True"
device_dst_file = "/system/framework/bundle_resource_manager.abc"
}
ohos_prebuilt_etc("bundle_resource_manager_etc") {
source = "$target_out_dir/bundle_resource_manager.abc"
module_install_dir = "framework"
subsystem_name = "bundlemanager"
part_name = "bundle_framework"
deps = [ ":bundle_resource_manager" ]
}
generate_static_abc("launcher_ability_resource_info") {
base_url = "./ets"
files = [
"./ets/bundleManager/LauncherAbilityResourceInfo.ets",
"./ets/bundleManager/LauncherAbilityResourceInfoInner.ets",
]
is_boot_abc = "True"
device_dst_file = "/system/framework/launcher_ability_resource_info.abc"
}
ohos_prebuilt_etc("launcher_ability_resource_info_etc") {
source = "$target_out_dir/launcher_ability_resource_info.abc"
module_install_dir = "framework"
subsystem_name = "bundlemanager"
part_name = "bundle_framework"
deps = [ ":launcher_ability_resource_info" ]
}