• 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("../powermgr.gni")
16
17config("utils_config") {
18  include_dirs = [ "native/include" ]
19}
20
21declare_args() {
22  power_manager_feature_coverage = false
23}
24
25config("coverage_flags") {
26  if (power_manager_feature_coverage) {
27    cflags = [ "--coverage" ]
28    cflags_cc += [ "--coverage" ]
29    ldflags = [ "--coverage" ]
30  }
31}
32
33ohos_executable("power-shell") {
34  include_dirs = [
35    "${powermgr_inner_api}/native/include",
36    "${powermgr_utils_path}/shell/include",
37    "${ability_runtime_services_path}/common/include",
38    "${ability_runtime_path}/tools/aa/include",
39  ]
40
41  sources = [
42    "shell/src/main.cpp",
43    "shell/src/power_shell_command.cpp",
44  ]
45
46  deps = [ "${powermgr_inner_api}:powermgr_client" ]
47
48  configs = [
49    "${ability_runtime_path}/tools/aa:ability_command_config",
50    "${ability_runtime_services_path}/common:common_config",
51    "${powermgr_utils_path}:coverage_flags",
52  ]
53
54  external_deps = [
55    "ability_runtime:tools_aa_source_set",
56    "c_utils:utils",
57    "hilog:libhilog",
58    "ipc:ipc_core",
59  ]
60
61  if (has_display_manager_part) {
62    external_deps += [ "display_manager:displaymgr" ]
63  }
64
65  install_enable = true
66  part_name = "${powermgr_part_name}"
67}
68