# Copyright (c) 2021-2022 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/ohos.gni") import("../bundletool.gni") config("tools_bm_config") { include_dirs = [ "include", "include/bundle_tool_callback", ] defines = [ "APP_LOG_TAG = \"BMSTool\"", "LOG_DOMAIN = 0xD001123", ] } ohos_source_set("tools_bm_source_set") { sources = [ "${common_path}/log/src/app_log_wrapper.cpp", "${kits_path}/js/bundlemgr/bundle_death_recipient.cpp", "src/bundle_command.cpp", "src/bundle_command_common.cpp", "src/main.cpp", "src/quick_fix_command.cpp", "src/quick_fix_status_callback_host_impl.cpp", "src/shell_command.cpp", "src/status_receiver_impl.cpp", ] public_configs = [ ":tools_bm_config" ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } external_deps = [ "ability_base:want", "ability_runtime:app_manager", "ability_runtime:quickfix_manager", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "os_account:os_account_innerkits", "samgr:samgr_proxy", ] public_external_deps = [ "bundle_framework:bundle_napi_common", "bundle_framework:libappexecfwk_common", "json:nlohmann_json_static", ] defines = [] if (account_enable_bm) { external_deps += [ "os_account:os_account_innerkits" ] defines += [ "ACCOUNT_ENABLE" ] } if (overlay_install_bm) { defines += [ "BUNDLE_FRAMEWORK_OVERLAY_INSTALLATION" ] } subsystem_name = "bundlemanager" part_name = "bundle_tool" } ohos_executable("bm") { deps = [ ":tools_bm_source_set" ] external_deps = [ "hilog:libhilog" ] install_enable = true subsystem_name = "bundlemanager" part_name = "bundle_tool" } ohos_source_set("tools_test_bm_source_set") { sources = [ "${common_path}/log/src/app_log_wrapper.cpp", "${kits_path}/js/bundlemgr/bundle_death_recipient.cpp", "src/bundle_command_common.cpp", "src/bundle_test_tool.cpp", "src/bundle_tool_callback/bundle_tool_callback_stub.cpp", "src/main_test_tool.cpp", "src/shell_command.cpp", "src/status_receiver_impl.cpp", ] public_configs = [ ":tools_bm_config" ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } use_exceptions = true deps = [] external_deps = [ "ability_base:want", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "jsoncpp:jsoncpp", "os_account:os_account_innerkits", "samgr:samgr_proxy", ] public_external_deps = [ "bundle_framework:bundle_napi_common", "bundle_framework:libappexecfwk_common", "json:nlohmann_json_static", ] defines = [] if (quick_fix_bm) { defines += [ "BUNDLE_FRAMEWORK_QUICK_FIX" ] sources += [ "src/quick_fix_status_callback_host_impl.cpp" ] } if (account_enable_bm) { external_deps += [ "os_account:os_account_innerkits" ] defines += [ "ACCOUNT_ENABLE" ] } if (distributed_bundle_framework_bm) { external_deps += [ "distributed_bundle_framework:dbms_fwk" ] defines += [ "DISTRIBUTED_BUNDLE_FRAMEWORK" ] } subsystem_name = "bundlemanager" part_name = "bundle_tool" } ohos_executable("bundle_test_tool") { deps = [ ":tools_test_bm_source_set" ] install_enable = false external_deps = [ "hilog:libhilog" ] subsystem_name = "bundlemanager" part_name = "bundle_tool" } group("tools_bm") { deps = [ ":bm", ":bundle_test_tool", ] }