• 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("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni")
15import("//build/ohos.gni")
16import("//foundation/ability/ability_runtime/ability_runtime.gni")
17
18es2abc_gen_abc("gen_delegator_mgmt_abc") {
19  src_js = rebase_path(
20          "${ability_runtime_native_path}/appkit/ability_delegator/runner_runtime/delegator_mgmt.js")
21  dst_file = rebase_path(target_out_dir + "/delegator_mgmt.abc")
22  in_puts = [ "${ability_runtime_native_path}/appkit/ability_delegator/runner_runtime/delegator_mgmt.js" ]
23  out_puts = [ target_out_dir + "/delegator_mgmt.abc" ]
24  extra_args = [ "--module" ]
25}
26
27gen_js_obj("delegator_mgmt_js") {
28  input = "${ability_runtime_native_path}/appkit/ability_delegator/runner_runtime/delegator_mgmt.js"
29  output = target_out_dir + "/delegator_mgmt.o"
30}
31
32gen_js_obj("delegator_mgmt_abc") {
33  input = get_label_info(":gen_delegator_mgmt_abc", "target_out_dir") +
34          "/delegator_mgmt.abc"
35  output = target_out_dir + "/delegator_mgmt_abc.o"
36  dep = ":gen_delegator_mgmt_abc"
37}
38
39config("appkit_exception_config") {
40  cflags_cc = [ "-fexceptions" ]
41}
42
43config("appkit_config") {
44  defines = [ "AMS_LOG_TAG = \"Appkit\"" ]
45  if (target_cpu == "arm64") {
46    defines += [ "_ARM64_" ]
47  }
48  if (target_cpu == "arm64") {
49    defines += [ "APP_USE_ARM64" ]
50  } else if (target_cpu == "arm") {
51    defines += [ "APP_USE_ARM" ]
52  }
53
54  include_dirs = [
55    "${ability_runtime_path}/interfaces/kits/native/ability/native",
56    "//third_party/json/include",
57  ]
58}
59
60config("appkit_public_config") {
61  visibility = [ ":*" ]
62  include_dirs = [
63    "${ability_base_kits_path}/configuration/include",
64    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_delegator",
65    "${global_path}/resource_management/interfaces/inner_api/include",
66  ]
67
68  if (ability_runtime_graphics) {
69    include_dirs += [
70      "${global_path}/i18n/frameworks/intl/include",
71      "//third_party/icu/icu4c/source/common",
72    ]
73
74    defines = [ "SUPPORT_GRAPHICS" ]
75  }
76}
77
78# build so
79ohos_shared_library("appkit_native") {
80  include_dirs = [
81    "native",
82    "${ability_runtime_path}/interfaces/kits/native/appkit",
83    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app",
84    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
85    "${ability_runtime_path}/interfaces/kits/native/appkit/app",
86    "${ability_runtime_path}/interfaces/kits/native/appkit/app/task",
87    "${ability_runtime_services_path}/common/include",
88    "${ability_runtime_path}/interfaces/kits/native/ability/native",
89    "${ability_runtime_path}/interfaces/kits/native/ability/native/recovery",
90    "${ability_runtime_services_path}/abilitymgr/include",
91    "${ability_runtime_napi_path}/inner/napi_common",
92  ]
93
94  configs = [
95    ":appkit_config",
96    ":appkit_exception_config",
97  ]
98
99  public_configs = [ ":appkit_public_config" ]
100
101  sources = [
102    "${ability_runtime_native_path}/appkit/ability_runtime/app/ability_stage.cpp",
103    "${ability_runtime_native_path}/appkit/ability_runtime/app/js_ability_stage.cpp",
104    "${ability_runtime_native_path}/appkit/ability_runtime/app/js_ability_stage_context.cpp",
105    "${ability_runtime_native_path}/appkit/app/ability_manager.cpp",
106    "${ability_runtime_native_path}/appkit/app/ability_record_mgr.cpp",
107    "${ability_runtime_native_path}/appkit/app/app_loader.cpp",
108    "${ability_runtime_native_path}/appkit/app/application_data_manager.cpp",
109    "${ability_runtime_native_path}/appkit/app/application_env.cpp",
110    "${ability_runtime_native_path}/appkit/app/application_env_impl.cpp",
111    "${ability_runtime_native_path}/appkit/app/application_impl.cpp",
112    "${ability_runtime_native_path}/appkit/app/idle_time.cpp",
113    "${ability_runtime_native_path}/appkit/app/main_thread.cpp",
114    "${ability_runtime_native_path}/appkit/app/mix_stack_dumper.cpp",
115    "${ability_runtime_native_path}/appkit/app/ohos_application.cpp",
116    "${ability_runtime_native_path}/appkit/app/watchdog.cpp",
117  ]
118  cflags = []
119  if (target_cpu == "arm") {
120    cflags += [ "-DBINDER_IPC_32BIT" ]
121  }
122  deps = [
123    ":appkit_delegator",
124    "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr",
125    "${ability_runtime_native_path}/appkit:app_context",
126    "${ability_runtime_native_path}/appkit:app_context_utils",
127    "${ability_runtime_native_path}/runtime:string_utils",
128    "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client",
129  ]
130
131  public_deps =
132      [ "${global_path}/resource_management/frameworks/resmgr:global_resmgr" ]
133  external_deps = [
134    "ability_base:configuration",
135    "ability_base:want",
136    "ability_runtime:ability_manager",
137    "ability_runtime:abilitykit_native",
138    "ability_runtime:app_manager",
139    "ability_runtime:form_extension",
140    "ability_runtime:runtime",
141    "ability_runtime:static_subscriber_extension",
142    "bundle_framework:appexecfwk_base",
143    "c_utils:utils",
144    "common_event_service:cesfwk_innerkits",
145    "eventhandler:libeventhandler",
146    "faultloggerd:lib_dfx_dump_catcher",
147    "faultloggerd:libfaultloggerd",
148    "hicollie_native:libhicollie",
149    "hisysevent_native:libhisysevent",
150    "hitrace_native:hitrace_meter",
151    "hiviewdfx_hilog_native:libhilog",
152    "init:libbegetutil",
153    "ipc:ipc_core",
154    "samgr:samgr_proxy",
155  ]
156
157  if (ability_runtime_graphics) {
158    deps += [ "//third_party/icu/icu4c:shared_icuuc" ]
159    public_deps += [ "${global_path}/i18n/frameworks/intl:intl_util" ]
160  }
161
162  defines = []
163  if (is_asan) {
164    defines += [ "SUPPORT_ASAN" ]
165  }
166
167  if (defined(global_parts_info.web_webview)) {
168    public_deps += [ "//base/web/webview/ohos_adapter:nweb_ohos_adapter" ]
169
170    include_dirs += [ "//base/web/webview/ohos_adapter/interfaces" ]
171
172    external_deps += [ "webview:libnweb" ]
173
174    defines += [ "NWEB" ]
175  }
176
177  subsystem_name = "ability"
178  part_name = "ability_runtime"
179}
180
181# build so
182ohos_shared_library("app_context") {
183  include_dirs = [
184    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
185    "${ability_runtime_path}/interfaces/kits/native/appkit/app",
186  ]
187
188  configs = [ ":appkit_config" ]
189
190  public_configs = [ ":appkit_public_config" ]
191
192  sources = [
193    "${ability_runtime_native_path}/appkit/ability_runtime/context/ability_lifecycle_callback.cpp",
194    "${ability_runtime_native_path}/appkit/ability_runtime/context/application_context.cpp",
195    "${ability_runtime_native_path}/appkit/ability_runtime/context/context_impl.cpp",
196    "${ability_runtime_native_path}/appkit/ability_runtime/context/environment_callback.cpp",
197    "${ability_runtime_native_path}/appkit/app/sys_mgr_client.cpp",
198  ]
199  cflags = []
200  if (target_cpu == "arm") {
201    cflags += [ "-DBINDER_IPC_32BIT" ]
202  }
203  deps = []
204
205  public_deps =
206      [ "${global_path}/resource_management/frameworks/resmgr:global_resmgr" ]
207
208  external_deps = [
209    "ability_base:configuration",
210    "ability_runtime:ability_deps_wrapper",
211    "ability_runtime:app_manager",
212    "ability_runtime:runtime",
213    "bundle_framework:appexecfwk_base",
214    "bundle_framework:appexecfwk_core",
215    "c_utils:utils",
216    "hiviewdfx_hilog_native:libhilog",
217    "init:libbegetutil",
218    "ipc:ipc_core",
219    "napi:ace_napi",
220    "samgr:samgr_proxy",
221  ]
222
223  if (ability_runtime_graphics) {
224    deps += [ "//third_party/icu/icu4c:shared_icuuc" ]
225    public_deps += [ "${global_path}/i18n/frameworks/intl:intl_util" ]
226  }
227
228  subsystem_name = "ability"
229  part_name = "ability_runtime"
230}
231
232# build so
233ohos_shared_library("app_context_utils") {
234  include_dirs = [
235    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
236    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app",
237  ]
238
239  configs = [ ":appkit_config" ]
240
241  public_configs = [ ":appkit_public_config" ]
242
243  sources = [
244    "ability_runtime/context/js_application_context_utils.cpp",
245    "ability_runtime/context/js_context_utils.cpp",
246    "ability_runtime/context/js_hap_module_info_utils.cpp",
247    "ability_runtime/context/js_resource_manager_utils.cpp",
248  ]
249  cflags = []
250  if (target_cpu == "arm") {
251    cflags += [ "-DBINDER_IPC_32BIT" ]
252  }
253  deps = [
254    "${ability_runtime_native_path}/appkit:app_context",
255    "${ability_runtime_native_path}/appkit:application_context_manager",
256  ]
257
258  public_deps =
259      [ "${global_path}/resource_management/frameworks/resmgr:global_resmgr" ]
260
261  external_deps = [
262    "ability_runtime:ability_runtime_error_util",
263    "ability_runtime:app_manager",
264    "ability_runtime:runtime",
265    "bundle_framework:appexecfwk_base",
266    "bundle_framework:appexecfwk_core",
267    "c_utils:utils",
268    "hiviewdfx_hilog_native:libhilog",
269    "ipc:ipc_core",
270    "napi:ace_napi",
271    "resource_management:resmgr_napi_core",
272  ]
273
274  if (ability_runtime_graphics) {
275    deps += [ "//third_party/icu/icu4c:shared_icuuc" ]
276    public_deps += [ "${global_path}/i18n/frameworks/intl:intl_util" ]
277  }
278
279  subsystem_name = "ability"
280  part_name = "ability_runtime"
281}
282
283# build so
284ohos_shared_library("appkit_delegator") {
285  include_dirs = [
286    "native",
287    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app",
288    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
289    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/ability_delegator/include",
290    "${ability_runtime_services_path}/common/include",
291    "${ability_runtime_path}/interfaces/kits/native/ability/native",
292    "${multimodalinput_path}/frameworks/proxy:libmmi-client",
293  ]
294
295  configs = [ ":appkit_config" ]
296
297  public_configs = [ ":appkit_public_config" ]
298
299  sources = [
300    "${ability_runtime_native_path}/appkit/ability_delegator/ability_delegator.cpp",
301    "${ability_runtime_native_path}/appkit/ability_delegator/ability_delegator_args.cpp",
302    "${ability_runtime_native_path}/appkit/ability_delegator/ability_delegator_registry.cpp",
303    "${ability_runtime_native_path}/appkit/ability_delegator/delegator_thread.cpp",
304    "${ability_runtime_native_path}/appkit/ability_delegator/iability_monitor.cpp",
305    "${ability_runtime_native_path}/appkit/ability_delegator/iability_stage_monitor.cpp",
306    "${ability_runtime_native_path}/appkit/ability_delegator/runner_runtime/js_test_runner.cpp",
307    "${ability_runtime_native_path}/appkit/ability_delegator/shell_cmd_result.cpp",
308    "${ability_runtime_native_path}/appkit/ability_delegator/test_runner.cpp",
309    "${ability_runtime_path}/tools/aa/src/shell_command_result.cpp",
310    "${ability_runtime_path}/tools/aa/src/test_observer_proxy.cpp",
311  ]
312
313  cflags = []
314  if (target_cpu == "arm") {
315    cflags += [ "-DBINDER_IPC_32BIT" ]
316  }
317
318  deps = [
319    ":delegator_mgmt_abc",
320    ":delegator_mgmt_js",
321    "${ability_runtime_native_path}/appkit:app_context",
322  ]
323
324  external_deps = [
325    "ability_base:want",
326    "ability_runtime:ability_manager",
327    "ability_runtime:runtime",
328    "bundle_framework:appexecfwk_base",
329    "c_utils:utils",
330    "eventhandler:libeventhandler",
331    "hiviewdfx_hilog_native:libhilog",
332    "ipc:ipc_core",
333  ]
334
335  public_deps = [ "//foundation/arkui/napi:ace_napi" ]
336
337  if (ability_runtime_graphics) {
338    deps += [ "//third_party/icu/icu4c:shared_icuuc" ]
339  }
340
341  subsystem_name = "ability"
342  part_name = "ability_runtime"
343}
344
345config("application_context_manager_config") {
346  include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context" ]
347}
348
349ohos_shared_library("application_context_manager") {
350  sources = [ "${ability_runtime_native_path}/appkit/ability_runtime/context/application_context_manager.cpp" ]
351
352  cflags = []
353  if (target_cpu == "arm") {
354    cflags += [ "-DBINDER_IPC_32BIT" ]
355  }
356
357  external_deps = [ "napi:ace_napi" ]
358
359  public_configs = [ ":application_context_manager_config" ]
360
361  subsystem_name = "ability"
362  part_name = "ability_runtime"
363}
364