1# Copyright (c) 2021-2022 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("../bundletool.gni") 16 17config("tools_bm_config") { 18 include_dirs = [ 19 "include", 20 "include/bundle_tool_callback", 21 "${common_path}/log/include", 22 "${kits_path}/js/bundlemgr", 23 "//third_party/json/include", 24 ] 25 26 defines = [ 27 "APP_LOG_TAG = \"BundleTool\"", 28 "LOG_DOMAIN = 0xD001120", 29 ] 30} 31 32ohos_source_set("tools_bm_source_set") { 33 sources = [ 34 "${common_path}/log/src/app_log_wrapper.cpp", 35 "${kits_path}/js/bundlemgr/bundle_death_recipient.cpp", 36 "src/bundle_command.cpp", 37 "src/bundle_command_common.cpp", 38 "src/main.cpp", 39 "src/quick_fix_command.cpp", 40 "src/shell_command.cpp", 41 "src/status_receiver_impl.cpp", 42 ] 43 44 public_configs = [ ":tools_bm_config" ] 45 46 cflags = [] 47 if (target_cpu == "arm") { 48 cflags += [ "-DBINDER_IPC_32BIT" ] 49 } 50 51 external_deps = [ 52 "ability_base:want", 53 "ability_runtime:quickfix_manager", 54 "bundle_framework:appexecfwk_base", 55 "bundle_framework:appexecfwk_core", 56 "c_utils:utils", 57 "common_event_service:cesfwk_innerkits", 58 "hilog:libhilog", 59 "init:libbegetutil", 60 "ipc:ipc_core", 61 "os_account:os_account_innerkits", 62 "samgr:samgr_proxy", 63 ] 64 65 defines = [] 66 if (account_enable_bm) { 67 external_deps += [ "os_account:os_account_innerkits" ] 68 defines += [ "ACCOUNT_ENABLE" ] 69 } 70 71 if (overlay_install_bm) { 72 defines += [ "BUNDLE_FRAMEWORK_OVERLAY_INSTALLATION" ] 73 } 74 75 part_name = "bundle_tool" 76} 77 78ohos_executable("bm") { 79 deps = [ ":tools_bm_source_set" ] 80 81 install_enable = true 82 83 subsystem_name = "bundlemanager" 84 part_name = "bundle_tool" 85} 86 87ohos_source_set("tools_test_bm_source_set") { 88 sources = [ 89 "${common_path}/log/src/app_log_wrapper.cpp", 90 "${kits_path}/js/bundlemgr/bundle_death_recipient.cpp", 91 "src/bundle_command_common.cpp", 92 "src/bundle_test_tool.cpp", 93 "src/bundle_tool_callback/bundle_tool_callback_stub.cpp", 94 "src/main_test_tool.cpp", 95 "src/shell_command.cpp", 96 "src/status_receiver_impl.cpp", 97 ] 98 99 public_configs = [ ":tools_bm_config" ] 100 101 cflags = [] 102 if (target_cpu == "arm") { 103 cflags += [ "-DBINDER_IPC_32BIT" ] 104 } 105 106 use_exceptions = true 107 108 deps = [ "//third_party/jsoncpp:jsoncpp" ] 109 110 external_deps = [ 111 "ability_base:want", 112 "bundle_framework:appexecfwk_base", 113 "bundle_framework:appexecfwk_core", 114 "c_utils:utils", 115 "common_event_service:cesfwk_innerkits", 116 "hilog:libhilog", 117 "init:libbegetutil", 118 "ipc:ipc_core", 119 "os_account:os_account_innerkits", 120 "samgr:samgr_proxy", 121 ] 122 123 defines = [] 124 if (quick_fix_bm) { 125 defines += [ "BUNDLE_FRAMEWORK_QUICK_FIX" ] 126 sources += [ "src/quick_fix_status_callback_host_impl.cpp" ] 127 } 128 129 if (account_enable_bm) { 130 external_deps += [ "os_account:os_account_innerkits" ] 131 defines += [ "ACCOUNT_ENABLE" ] 132 } 133 134 if (distributed_bundle_framework_bm) { 135 external_deps += [ "distributed_bundle_framework:dbms_fwk" ] 136 defines += [ "DISTRIBUTED_BUNDLE_FRAMEWORK" ] 137 } 138 139 part_name = "bundle_tool" 140} 141 142ohos_executable("bundle_test_tool") { 143 deps = [ ":tools_test_bm_source_set" ] 144 145 install_enable = false 146 147 subsystem_name = "bundlemanager" 148 part_name = "bundle_tool" 149} 150 151group("tools_bm") { 152 deps = [ 153 ":bm", 154 ":bundle_test_tool", 155 ] 156} 157