• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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")
15
16if (is_mac) {
17  dylib_suffix = ".dylib"
18  exec_suffix = ""
19  platform = "mac"
20} else {
21  dylib_suffix = ".dll"
22  exec_suffix = ".exe"
23  platform = "windows"
24}
25
26not_needed("*",
27           [
28             "dylib_suffix",
29             "exec_suffix",
30             "platform",
31           ])
32
33ohos_copy("ability_simulator_copy_ability_modules") {
34  deps = []
35  sources = []
36
37  napi_modules = [ "napi_module/want_constant:wantconstant_napi" ]
38
39  foreach(module, napi_modules) {
40    deps += [ module ]
41    out_path = get_label_info(module, "root_out_dir")
42    out_name = get_label_info(module, "name")
43    sources += [ out_path + "/ability/simulator/lib" + out_name + dylib_suffix ]
44  }
45
46  target_path = get_label_info(":copy_ability_simulator", "target_out_dir")
47
48  outputs = [ target_path + "/bin/module/ability/{{source_file_part}}" ]
49}
50
51ohos_copy("ability_simulator_copy_application_modules") {
52  deps = []
53  sources = []
54
55  napi_modules = [
56    "napi_module/ability:ability_napi",
57    "napi_module/ability_constant:abilityconstant_napi",
58    "napi_module/ability_context:ability_context_napi",
59    "napi_module/ability_stage:ability_stage_napi",
60    "napi_module/ability_stage_context:ability_stage_context_napi",
61    "napi_module/application_context:application_context_napi",
62    "napi_module/caller:caller_napi",
63    "napi_module/callee:callee_napi",
64    "napi_module/context:context_napi",
65    "napi_module/configuration_constant:configurationconstant_napi",
66  ]
67
68  foreach(module, napi_modules) {
69    deps += [ module ]
70    out_path = get_label_info(module, "root_out_dir")
71    out_name = get_label_info(module, "name")
72    sources += [ out_path + "/ability/simulator/lib" + out_name + dylib_suffix ]
73  }
74
75  target_path = get_label_info(":copy_ability_simulator", "target_out_dir")
76
77  outputs = [ target_path + "/bin/module/application/{{source_file_part}}" ]
78}
79
80ohos_copy("copy_ability_simulator") {
81  deps = [
82    ":ability_simulator_copy_ability_modules",
83    ":ability_simulator_copy_application_modules",
84  ]
85  sources = []
86
87  deps += [ "test:ability_simulator_test" ]
88  out_path = get_label_info("test:ability_simulator_test", "root_out_dir")
89  sources +=
90      [ out_path + "/ability/simulator/ability_simulator_test" + exec_suffix ]
91
92  deps += [ "ability_simulator:ability_simulator" ]
93  out_path =
94      get_label_info("ability_simulator:ability_simulator", "root_out_dir")
95  sources +=
96      [ out_path + "/ability/simulator/libability_simulator" + dylib_suffix ]
97
98  deps += [ "//foundation/arkui/napi:ace_napi" ]
99  out_path = get_label_info("//foundation/arkui/napi:ace_napi", "root_out_dir")
100  sources += [ out_path + "/arkui/napi/libace_napi" + dylib_suffix ]
101
102  deps += [ "//foundation/arkui/napi:ace_napi_ark" ]
103  out_path =
104      get_label_info("//foundation/arkui/napi:ace_napi_ark", "root_out_dir")
105  sources += [ out_path + "/arkui/napi/libace_napi_ark" + dylib_suffix ]
106
107  deps += [ "//arkcompiler/ets_runtime:libark_jsruntime" ]
108  out_path = get_label_info("//arkcompiler/ets_runtime:libark_jsruntime",
109                            "root_out_dir")
110  sources +=
111      [ out_path + "/arkcompiler/ets_runtime/libark_jsruntime" + dylib_suffix ]
112
113  deps += [ "//arkcompiler/toolchain/tooling:libark_ecma_debugger" ]
114  out_path =
115      get_label_info("//arkcompiler/toolchain/tooling:libark_ecma_debugger",
116                     "root_out_dir")
117  sources += [ out_path + "/arkcompiler/toolchain/libark_ecma_debugger" +
118               dylib_suffix ]
119
120  deps += [ "//arkcompiler/toolchain/inspector:ark_debugger" ]
121  out_path = get_label_info("//arkcompiler/toolchain/inspector:ark_debugger",
122                            "root_out_dir")
123  sources +=
124      [ out_path + "/arkcompiler/toolchain/libark_debugger" + dylib_suffix ]
125
126  deps += [ "//third_party/libuv:uv" ]
127  out_path = get_label_info("//third_party/libuv:uv", "root_out_dir")
128  sources += [ out_path + "/thirdparty/libuv/libuv" + dylib_suffix ]
129
130  deps += [
131    "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_$platform",
132  ]
133  out_path = get_label_info(
134          "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_$platform",
135          "root_out_dir")
136  sources +=
137      [ out_path + "/hiviewdfx/hilog_native/libhilog_$platform" + dylib_suffix ]
138
139  deps += [ "//third_party/icu/icu4c:shared_icui18n" ]
140  out_path =
141      get_label_info("//third_party/icu/icu4c:shared_icui18n", "root_out_dir")
142  sources += [ out_path + "/thirdparty/icu/libhmicui18n" + dylib_suffix ]
143
144  deps += [ "//third_party/icu/icu4c:shared_icuuc" ]
145  out_path =
146      get_label_info("//third_party/icu/icu4c:shared_icuuc", "root_out_dir")
147  sources += [ out_path + "/thirdparty/icu/libhmicuuc" + dylib_suffix ]
148
149  deps += [ "//third_party/bounds_checking_function:libsec_shared" ]
150  out_path =
151      get_label_info("//third_party/bounds_checking_function:libsec_shared",
152                     "root_out_dir")
153  sources += [ out_path + "/thirdparty/bounds_checking_function/libsec_shared" +
154               dylib_suffix ]
155
156  outputs = [ target_out_dir + "/bin/{{source_file_part}}" ]
157  module_source_dir = target_out_dir + "/bin"
158  module_install_name = ""
159}
160