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:ability_manager", 54 "ability_runtime:quickfix_manager", 55 "bundle_framework:appexecfwk_base", 56 "bundle_framework:appexecfwk_core", 57 "c_utils:utils", 58 "common_event_service:cesfwk_innerkits", 59 "hilog:libhilog", 60 "init:libbegetutil", 61 "ipc:ipc_core", 62 "os_account:os_account_innerkits", 63 "samgr:samgr_proxy", 64 ] 65 66 defines = [] 67 if (account_enable_bm) { 68 external_deps += [ "os_account:os_account_innerkits" ] 69 defines += [ "ACCOUNT_ENABLE" ] 70 } 71 72 if (overlay_install_bm) { 73 defines += [ "BUNDLE_FRAMEWORK_OVERLAY_INSTALLATION" ] 74 } 75 76 part_name = "bundle_tool" 77} 78 79ohos_executable("bm") { 80 deps = [ ":tools_bm_source_set" ] 81 82 install_enable = true 83 84 subsystem_name = "bundlemanager" 85 part_name = "bundle_tool" 86} 87 88ohos_source_set("tools_test_bm_source_set") { 89 sources = [ 90 "${common_path}/log/src/app_log_wrapper.cpp", 91 "${kits_path}/js/bundlemgr/bundle_death_recipient.cpp", 92 "src/bundle_command_common.cpp", 93 "src/bundle_test_tool.cpp", 94 "src/bundle_tool_callback/bundle_tool_callback_stub.cpp", 95 "src/main_test_tool.cpp", 96 "src/shell_command.cpp", 97 "src/status_receiver_impl.cpp", 98 ] 99 100 public_configs = [ ":tools_bm_config" ] 101 102 cflags = [] 103 if (target_cpu == "arm") { 104 cflags += [ "-DBINDER_IPC_32BIT" ] 105 } 106 107 use_exceptions = true 108 109 deps = [ "//third_party/jsoncpp:jsoncpp" ] 110 111 external_deps = [ 112 "ability_base:want", 113 "bundle_framework:appexecfwk_base", 114 "bundle_framework:appexecfwk_core", 115 "c_utils:utils", 116 "common_event_service:cesfwk_innerkits", 117 "hilog:libhilog", 118 "init:libbegetutil", 119 "ipc:ipc_core", 120 "os_account:os_account_innerkits", 121 "samgr:samgr_proxy", 122 ] 123 124 defines = [] 125 if (quick_fix_bm) { 126 defines += [ "BUNDLE_FRAMEWORK_QUICK_FIX" ] 127 sources += [ "src/quick_fix_status_callback_host_impl.cpp" ] 128 } 129 130 if (account_enable_bm) { 131 external_deps += [ "os_account:os_account_innerkits" ] 132 defines += [ "ACCOUNT_ENABLE" ] 133 } 134 135 if (distributed_bundle_framework_bm) { 136 external_deps += [ "distributed_bundle_framework:dbms_fwk" ] 137 defines += [ "DISTRIBUTED_BUNDLE_FRAMEWORK" ] 138 } 139 140 part_name = "bundle_tool" 141} 142 143ohos_executable("bundle_test_tool") { 144 deps = [ ":tools_test_bm_source_set" ] 145 146 install_enable = false 147 148 subsystem_name = "bundlemanager" 149 part_name = "bundle_tool" 150} 151 152group("tools_bm") { 153 deps = [ 154 ":bm", 155 ":bundle_test_tool", 156 ] 157} 158