• 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/test.gni")
15import("//foundation/ability/ability_runtime/ability_runtime.gni")
16
17config("ability_command_config") {
18  include_dirs = [
19    "include",
20    "${ability_runtime_innerkits_path}/app_manager/include/appmgr",
21    "${ability_runtime_services_path}/abilitymgr/include",
22    "${bundlefwk_inner_api_path}/appexecfwk_base/include",
23    "${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy/include",
24    "//third_party/jsoncpp/include",
25  ]
26}
27
28ohos_source_set("tools_aa_source_set") {
29  sources = [
30    "src/ability_command.cpp",
31    "src/ability_tool_command.cpp",
32    "src/shell_command.cpp",
33    "src/shell_command_config_loader.cpp",
34    "src/shell_command_executor.cpp",
35    "src/shell_command_result.cpp",
36    "src/system_time.cpp",
37    "src/test_observer.cpp",
38    "src/test_observer_proxy.cpp",
39    "src/test_observer_stub.cpp",
40  ]
41
42  public_configs = [
43    ":ability_command_config",
44    "${ability_runtime_services_path}/abilitymgr:abilityms_config",
45    "${ability_runtime_services_path}/common:common_config",
46  ]
47
48  cflags = []
49  if (target_cpu == "arm") {
50    cflags += [ "-DBINDER_IPC_32BIT" ]
51  }
52
53  deps = [
54    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
55    "${ability_runtime_innerkits_path}/app_manager:app_manager",
56    "${ability_runtime_services_path}/abilitymgr:abilityms",
57  ]
58
59  external_deps = [
60    "ability_base:base",
61    "ability_base:want",
62    "bundle_framework:appexecfwk_base",
63    "bundle_framework:appexecfwk_core",
64    "c_utils:utils",
65    "eventhandler:libeventhandler",
66    "hiviewdfx_hilog_native:libhilog",
67    "ipc:ipc_core",
68    "samgr:samgr_proxy",
69  ]
70
71  subsystem_name = "ability"
72  part_name = "ability_tools"
73}
74
75ohos_executable("aa") {
76  sources = [ "src/main.cpp" ]
77
78  cflags = []
79  if (target_cpu == "arm") {
80    cflags += [ "-DBINDER_IPC_32BIT" ]
81  }
82
83  deps = [ ":tools_aa_source_set" ]
84
85  external_deps = [
86    "ability_base:base",
87    "ability_base:configuration",
88    "hiviewdfx_hilog_native:libhilog",
89    "ipc:ipc_core",
90  ]
91
92  symlink_target_name = [ "ability_tool" ]
93
94  defines = []
95  print("accessibility_enable = ", accessibility_enable)
96  if (accessibility_enable) {
97    sources += [
98      "src/accessibility_ability_command.cpp",
99      "src/accessibility_ability_utils.cpp",
100    ]
101
102    deps += [
103      "//base/security/access_token/interfaces/innerkits/nativetoken:libnativetoken",
104      "//base/security/access_token/interfaces/innerkits/token_setproc:libtoken_setproc",
105    ]
106
107    external_deps += [
108      "access_token:libaccesstoken_sdk",
109      "accessibility:accessibility_common",
110      "accessibility:accessibilityclient",
111      "accessibility:accessibilityconfig",
112    ]
113    defines += [ "A11Y_ENABLE" ]
114    symlink_target_name += [ "accessibility" ]
115  }
116
117  install_enable = true
118
119  subsystem_name = "ability"
120  part_name = "ability_tools"
121}
122
123ohos_prebuilt_etc("shell_command_excutor_config.json") {
124  source = "resource/shell_command_excutor_config.json"
125  subsystem_name = "ability"
126  part_name = "ability_tools"
127}
128
129group("tools_aa") {
130  deps = [
131    ":aa",
132    ":shell_command_excutor_config.json",
133  ]
134}
135