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