• 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")
15import("//foundation/ability/ability_runtime/ability_runtime.gni")
16
17if (is_mac) {
18  dylib_suffix = ".dylib"
19} else {
20  dylib_suffix = ".dll"
21}
22
23not_needed("*", [ "dylib_suffix" ])
24
25ohos_copy("ability_simulator_copy_ability_modules") {
26  deps = []
27  sources = []
28
29  napi_modules = [ "napi_module/want_constant:wantconstant_napi" ]
30
31  foreach(module, napi_modules) {
32    deps += [ module ]
33    out_path = get_label_info(module, "root_out_dir")
34    out_name = get_label_info(module, "name")
35    sources +=
36        [ out_path + "/ability/ability_runtime/lib" + out_name + dylib_suffix ]
37  }
38
39  target_path = get_label_info(":copy_ability_simulator", "target_out_dir")
40
41  outputs = [ target_path + "/bin/module/ability/{{source_file_part}}" ]
42}
43
44ohos_copy("ability_simulator_copy_application_modules") {
45  deps = []
46  sources = []
47
48  napi_modules = [
49    "napi_module/ability:ability_napi",
50    "napi_module/ability_context:abilitycontext_napi",
51    "napi_module/ability_stage_context:abilitystagecontext_napi",
52    "napi_module/application_context:applicationcontext_napi",
53    "napi_module/caller:caller_napi",
54    "napi_module/callee:callee",
55    "napi_module/context:context_napi",
56  ]
57
58  foreach(module, napi_modules) {
59    deps += [ module ]
60    out_path = get_label_info(module, "root_out_dir")
61    out_name = get_label_info(module, "name")
62    sources +=
63        [ out_path + "/ability/ability_runtime/lib" + out_name + dylib_suffix ]
64  }
65
66  target_path = get_label_info(":copy_ability_simulator", "target_out_dir")
67
68  outputs = [ target_path + "/bin/module/application/{{source_file_part}}" ]
69}
70
71ohos_copy("ability_simulator_copy_app_ability_modules") {
72  deps = []
73  sources = []
74
75  napi_modules = [
76    "napi_module/uiability:uiability",
77    "napi_module/ability_stage:abilitystage",
78    "napi_module/ability_constant:abilityconstant",
79    "napi_module/configuration_constant:configurationconstant",
80  ]
81
82  foreach(module, napi_modules) {
83    deps += [ module ]
84    out_path = get_label_info(module, "root_out_dir")
85    out_name = get_label_info(module, "name")
86    sources +=
87        [ out_path + "/ability/ability_runtime/lib" + out_name + dylib_suffix ]
88  }
89
90  target_path = get_label_info(":copy_ability_simulator", "target_out_dir")
91
92  outputs = [ target_path + "/bin/module/app/ability/{{source_file_part}}" ]
93
94  part_name = "ability_runtime"
95  subsystem_name = "ability"
96}
97
98ohos_copy("copy_ability_simulator") {
99  deps = [
100    ":ability_simulator_copy_ability_modules",
101    ":ability_simulator_copy_app_ability_modules",
102    ":ability_simulator_copy_application_modules",
103  ]
104  sources = []
105
106  deps += [ "test:ability_simulator_test" ]
107  out_path = get_label_info("test:ability_simulator_test", "root_out_dir")
108
109  deps += [ "ability_simulator:ability_simulator" ]
110  out_path =
111      get_label_info("ability_simulator:ability_simulator", "root_out_dir")
112  sources += [ out_path + "/ability/ability_runtime/libability_simulator" +
113               dylib_suffix ]
114
115  deps += [ "${ability_base_path}:string_utils" ]
116  out_path = get_label_info("${ability_base_path}:string_utils", "root_out_dir")
117  sources +=
118      [ out_path + "/ability/ability_base/libstring_utils" + dylib_suffix ]
119
120  deps += [ "${arkui_path}/napi:ace_napi" ]
121  out_path = get_label_info("${arkui_path}/napi:ace_napi", "root_out_dir")
122  sources += [ out_path + "/arkui/napi/libace_napi" + dylib_suffix ]
123
124  deps += [ "//arkcompiler/ets_runtime:libark_jsruntime" ]
125  out_path = get_label_info("//arkcompiler/ets_runtime:libark_jsruntime",
126                            "root_out_dir")
127  sources +=
128      [ out_path + "/arkcompiler/ets_runtime/libark_jsruntime" + dylib_suffix ]
129
130  deps += [ "//arkcompiler/toolchain/tooling:libark_ecma_debugger" ]
131  out_path =
132      get_label_info("//arkcompiler/toolchain/tooling:libark_ecma_debugger",
133                     "root_out_dir")
134  sources += [ out_path + "/arkcompiler/toolchain/libark_ecma_debugger" +
135               dylib_suffix ]
136
137  deps += [ "//arkcompiler/toolchain/inspector:ark_debugger" ]
138  out_path = get_label_info("//arkcompiler/toolchain/inspector:ark_debugger",
139                            "root_out_dir")
140  sources +=
141      [ out_path + "/arkcompiler/toolchain/libark_debugger" + dylib_suffix ]
142
143  deps += [ "//third_party/libuv:uv" ]
144  out_path = get_label_info("//third_party/libuv:uv", "root_out_dir")
145  sources += [ out_path + "/thirdparty/libuv/libuv" + dylib_suffix ]
146
147  deps += [ "${hilog_path}/interfaces/native/innerkits:libhilog" ]
148  out_path =
149      get_label_info("${hilog_path}/interfaces/native/innerkits:libhilog",
150                     "root_out_dir")
151  sources += [ out_path + "/hiviewdfx/hilog/libhilog" + dylib_suffix ]
152
153  deps += [ "//third_party/icu/icu4c:shared_icui18n" ]
154  out_path =
155      get_label_info("//third_party/icu/icu4c:shared_icui18n", "root_out_dir")
156  sources += [ out_path + "/thirdparty/icu/libhmicui18n" + dylib_suffix ]
157
158  deps += [ "//third_party/icu/icu4c:shared_icuuc" ]
159  out_path =
160      get_label_info("//third_party/icu/icu4c:shared_icuuc", "root_out_dir")
161  sources += [ out_path + "/thirdparty/icu/libhmicuuc" + dylib_suffix ]
162
163  deps += [ "//third_party/bounds_checking_function:libsec_shared" ]
164  out_path =
165      get_label_info("//third_party/bounds_checking_function:libsec_shared",
166                     "root_out_dir")
167  sources += [ out_path + "/thirdparty/bounds_checking_function/libsec_shared" +
168               dylib_suffix ]
169
170  deps += [ "${ets_utils_path}/js_sys_module/timer:timer" ]
171  out_path = get_label_info("${ets_utils_path}/js_sys_module/timer:timer",
172                            "root_out_dir")
173  sources += [ out_path + "/commonlibrary/ets_utils/libtimer" + dylib_suffix ]
174
175  deps += [ "${ets_utils_path}/js_sys_module/console:console" ]
176  out_path = get_label_info("${ets_utils_path}/js_sys_module/console:console",
177                            "root_out_dir")
178  sources += [ out_path + "/commonlibrary/ets_utils/libconsole" + dylib_suffix ]
179
180  outputs = [ target_out_dir + "/bin/{{source_file_part}}" ]
181  module_source_dir = target_out_dir + "/bin"
182  module_install_name = ""
183}
184