1eace7efcSopenharmony_ci# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
2eace7efcSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3eace7efcSopenharmony_ci# you may not use this file except in compliance with the License.
4eace7efcSopenharmony_ci# You may obtain a copy of the License at
5eace7efcSopenharmony_ci#
6eace7efcSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7eace7efcSopenharmony_ci#
8eace7efcSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9eace7efcSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10eace7efcSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11eace7efcSopenharmony_ci# See the License for the specific language governing permissions and
12eace7efcSopenharmony_ci# limitations under the License.
13eace7efcSopenharmony_ci
14eace7efcSopenharmony_ciimport("//build/config/components/ets_frontend/es2abc_config.gni")
15eace7efcSopenharmony_ciimport("//build/ohos.gni")
16eace7efcSopenharmony_ciimport("//build/templates/abc/ohos_abc.gni")
17eace7efcSopenharmony_ciimport("//commonlibrary/memory_utils/purgeable_mem_config.gni")
18eace7efcSopenharmony_ciimport("//foundation/ability/ability_runtime/ability_runtime.gni")
19eace7efcSopenharmony_ci
20eace7efcSopenharmony_ciohos_abc("delegator_mgmt") {
21eace7efcSopenharmony_ci  sources = [ "${ability_runtime_native_path}/appkit/ability_delegator/runner_runtime/delegator_mgmt.js" ]
22eace7efcSopenharmony_ci  output_name = "delegator_mgmt"
23eace7efcSopenharmony_ci  install_images = [ "system" ]
24eace7efcSopenharmony_ci  module_install_dir = "etc/abc/ability"
25eace7efcSopenharmony_ci  subsystem_name = "ability"
26eace7efcSopenharmony_ci  part_name = "ability_runtime"
27eace7efcSopenharmony_ci}
28eace7efcSopenharmony_ci
29eace7efcSopenharmony_ciconfig("appkit_exception_config") {
30eace7efcSopenharmony_ci  cflags_cc = [ "-fexceptions" ]
31eace7efcSopenharmony_ci}
32eace7efcSopenharmony_ci
33eace7efcSopenharmony_ciconfig("appkit_config") {
34eace7efcSopenharmony_ci  defines = [ "AMS_LOG_TAG = \"Appkit\"" ]
35eace7efcSopenharmony_ci  defines += [ "AMS_LOG_DOMAIN = 0xD001305" ]
36eace7efcSopenharmony_ci  if (target_cpu == "arm64") {
37eace7efcSopenharmony_ci    defines += [ "_ARM64_" ]
38eace7efcSopenharmony_ci  }
39eace7efcSopenharmony_ci  if (target_cpu == "arm64") {
40eace7efcSopenharmony_ci    defines += [ "APP_USE_ARM64" ]
41eace7efcSopenharmony_ci  } else if (target_cpu == "arm") {
42eace7efcSopenharmony_ci    defines += [ "APP_USE_ARM" ]
43eace7efcSopenharmony_ci  } else if (target_cpu == "x86_64") {
44eace7efcSopenharmony_ci    defines += [ "APP_USE_X86_64" ]
45eace7efcSopenharmony_ci  }
46eace7efcSopenharmony_ci
47eace7efcSopenharmony_ci  include_dirs = [
48eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/app",
49eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/dfr",
50eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/ability/native",
51eace7efcSopenharmony_ci  ]
52eace7efcSopenharmony_ci}
53eace7efcSopenharmony_ci
54eace7efcSopenharmony_ciconfig("appkit_public_config") {
55eace7efcSopenharmony_ci  visibility = [ ":*" ]
56eace7efcSopenharmony_ci  include_dirs = [
57eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_delegator",
58eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app",
59eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
60eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/app",
61eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/dfr",
62eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper",
63eace7efcSopenharmony_ci  ]
64eace7efcSopenharmony_ci
65eace7efcSopenharmony_ci  if (ability_runtime_graphics) {
66eace7efcSopenharmony_ci    defines = [
67eace7efcSopenharmony_ci      "SUPPORT_GRAPHICS",
68eace7efcSopenharmony_ci      "SUPPORT_SCREEN",
69eace7efcSopenharmony_ci      "SUPPORT_APP_PREFERRED_LANGUAGE",
70eace7efcSopenharmony_ci    ]
71eace7efcSopenharmony_ci  }
72eace7efcSopenharmony_ci}
73eace7efcSopenharmony_ci
74eace7efcSopenharmony_ci# build so
75eace7efcSopenharmony_ciohos_shared_library("appkit_native") {
76eace7efcSopenharmony_ci  include_dirs = [
77eace7efcSopenharmony_ci    "native",
78eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/inner_api/error_utils/include",
79eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit",
80eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper",
81eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
82eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/app",
83eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/dfr",
84eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/app/task",
85eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/app_startup",
86eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/deps_wrapper/include",
87eace7efcSopenharmony_ci    "${ability_runtime_services_path}/common/include",
88eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/ability/native",
89eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/ability/native/recovery",
90eace7efcSopenharmony_ci    "${ability_runtime_path}/utils/global/time/include",
91eace7efcSopenharmony_ci    "${ability_runtime_services_path}/abilitymgr/include/utils",
92eace7efcSopenharmony_ci    "${ability_runtime_services_path}/abilitymgr/include",
93eace7efcSopenharmony_ci    "${ability_runtime_napi_path}/inner/napi_common",
94eace7efcSopenharmony_ci    "${ability_runtime_utils_path}/global/constant",
95eace7efcSopenharmony_ci  ]
96eace7efcSopenharmony_ci
97eace7efcSopenharmony_ci  if (ability_runtime_graphics) {
98eace7efcSopenharmony_ci    include_dirs += [ "${graphic_path}/frameworks/opengl_wrapper/src/EGL" ]
99eace7efcSopenharmony_ci  }
100eace7efcSopenharmony_ci
101eace7efcSopenharmony_ci  configs = [
102eace7efcSopenharmony_ci    ":appkit_config",
103eace7efcSopenharmony_ci    ":appkit_exception_config",
104eace7efcSopenharmony_ci  ]
105eace7efcSopenharmony_ci
106eace7efcSopenharmony_ci  public_configs = [ ":appkit_public_config" ]
107eace7efcSopenharmony_ci
108eace7efcSopenharmony_ci  sources = [
109eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_runtime/app/ability_stage.cpp",
110eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_runtime/app/js_ability_stage.cpp",
111eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_runtime/app/js_ability_stage_context.cpp",
112eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/ability_record_mgr.cpp",
113eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/app_loader.cpp",
114eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/application_cleaner.cpp",
115eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/application_data_manager.cpp",
116eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/application_env.cpp",
117eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/application_env_impl.cpp",
118eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/application_impl.cpp",
119eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/assert_fault_callback.cpp",
120eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/assert_fault_task_thread.cpp",
121eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/child_main_thread.cpp",
122eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/dump_ffrt_helper.cpp",
123eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/dump_ipc_helper.cpp",
124eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/dump_runtime_helper.cpp",
125eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/extension_plugin_info.cpp",
126eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/idle_time.cpp",
127eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/main_thread.cpp",
128eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/native_lib_util.cpp",
129eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/ohos_application.cpp",
130eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app_startup/js_startup_config.cpp",
131eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app_startup/js_startup_task.cpp",
132eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app_startup/js_startup_task_executor.cpp",
133eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app_startup/js_startup_task_result.cpp",
134eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app_startup/startup_config.cpp",
135eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app_startup/startup_listener.cpp",
136eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app_startup/startup_manager.cpp",
137eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app_startup/startup_task.cpp",
138eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app_startup/startup_task_dispatcher.cpp",
139eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app_startup/startup_task_manager.cpp",
140eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app_startup/startup_task_result.cpp",
141eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app_startup/startup_topologysort.cpp",
142eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app_startup/startup_utils.cpp",
143eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/dfr/appfreeze_inner.cpp",
144eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/dfr/appfreeze_state.cpp",
145eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/dfr/watchdog.cpp",
146eace7efcSopenharmony_ci  ]
147eace7efcSopenharmony_ci  cflags = []
148eace7efcSopenharmony_ci  if (target_cpu == "arm") {
149eace7efcSopenharmony_ci    cflags += [ "-DBINDER_IPC_32BIT" ]
150eace7efcSopenharmony_ci  }
151eace7efcSopenharmony_ci  deps = [
152eace7efcSopenharmony_ci    ":appkit_delegator",
153eace7efcSopenharmony_ci    "${ability_runtime_abilitymgr_path}/:abilityms",
154eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
155eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/ability_manager:ability_start_options",
156eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/app_manager:app_manager",
157eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/child_process_manager:child_process_manager",
158eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper",
159eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/runtime:runtime",
160eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr",
161eace7efcSopenharmony_ci    "${ability_runtime_native_path}/ability/native:ability_thread",
162eace7efcSopenharmony_ci    "${ability_runtime_native_path}/ability/native:abilitykit_native",
163eace7efcSopenharmony_ci    "${ability_runtime_native_path}/ability/native:configuration_helper",
164eace7efcSopenharmony_ci    "${ability_runtime_native_path}/ability/native:uiabilitykit_native",
165eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit:app_context",
166eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit:app_context_utils",
167eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit:appkit_manager_helper",
168eace7efcSopenharmony_ci    "${ability_runtime_path}/js_environment/frameworks/js_environment:js_environment",
169eace7efcSopenharmony_ci    "${ability_runtime_path}/utils/global/freeze:freeze_util",
170eace7efcSopenharmony_ci    "${ability_runtime_services_path}/common:app_util",
171eace7efcSopenharmony_ci  ]
172eace7efcSopenharmony_ci
173eace7efcSopenharmony_ci  external_deps = [
174eace7efcSopenharmony_ci    "ability_base:base",
175eace7efcSopenharmony_ci    "ability_base:extractresourcemanager",
176eace7efcSopenharmony_ci    "ability_base:string_utils",
177eace7efcSopenharmony_ci    "ability_base:want",
178eace7efcSopenharmony_ci    "access_token:libaccesstoken_sdk",
179eace7efcSopenharmony_ci    "bundle_framework:appexecfwk_base",
180eace7efcSopenharmony_ci    "bundle_framework:appexecfwk_core",
181eace7efcSopenharmony_ci    "c_utils:utils",
182eace7efcSopenharmony_ci    "common_event_service:cesfwk_innerkits",
183eace7efcSopenharmony_ci    "ets_runtime:libark_jsruntime",
184eace7efcSopenharmony_ci    "eventhandler:libeventhandler",
185eace7efcSopenharmony_ci    "faultloggerd:libbacktrace_local",
186eace7efcSopenharmony_ci    "faultloggerd:libdfx_procinfo",
187eace7efcSopenharmony_ci    "faultloggerd:libfaultloggerd",
188eace7efcSopenharmony_ci    "ffrt:libffrt",
189eace7efcSopenharmony_ci    "hicollie:libhicollie",
190eace7efcSopenharmony_ci    "hilog:libhilog",
191eace7efcSopenharmony_ci    "hisysevent:libhisysevent",
192eace7efcSopenharmony_ci    "hitrace:hitrace_meter",
193eace7efcSopenharmony_ci    "i18n:preferred_language",
194eace7efcSopenharmony_ci    "init:libbegetutil",
195eace7efcSopenharmony_ci    "ipc:ipc_core",
196eace7efcSopenharmony_ci    "json:nlohmann_json_static",
197eace7efcSopenharmony_ci    "napi:ace_napi",
198eace7efcSopenharmony_ci    "resource_management:global_resmgr",
199eace7efcSopenharmony_ci    "safwk:system_ability_fwk",
200eace7efcSopenharmony_ci    "samgr:samgr_proxy",
201eace7efcSopenharmony_ci  ]
202eace7efcSopenharmony_ci  public_external_deps = [ "ability_base:configuration" ]
203eace7efcSopenharmony_ci
204eace7efcSopenharmony_ci  if (ability_runtime_graphics) {
205eace7efcSopenharmony_ci    external_deps += [
206eace7efcSopenharmony_ci      "ace_engine:ace_forward_compatibility",
207eace7efcSopenharmony_ci      "graphic_2d:librender_service_client",
208eace7efcSopenharmony_ci      "i18n:intl_util",
209eace7efcSopenharmony_ci      "icu:shared_icuuc",
210eace7efcSopenharmony_ci      "window_manager:libwm",
211eace7efcSopenharmony_ci    ]
212eace7efcSopenharmony_ci  }
213eace7efcSopenharmony_ci
214eace7efcSopenharmony_ci  defines = []
215eace7efcSopenharmony_ci  if (is_asan || asan_detector) {
216eace7efcSopenharmony_ci    defines += [ "SUPPORT_ASAN" ]
217eace7efcSopenharmony_ci  }
218eace7efcSopenharmony_ci
219eace7efcSopenharmony_ci  if (defined(global_parts_info.web_webview)) {
220eace7efcSopenharmony_ci    external_deps += [
221eace7efcSopenharmony_ci      "webview:libnweb",
222eace7efcSopenharmony_ci      "webview:nweb_ohos_adapter",
223eace7efcSopenharmony_ci    ]
224eace7efcSopenharmony_ci
225eace7efcSopenharmony_ci    defines += [ "NWEB" ]
226eace7efcSopenharmony_ci  }
227eace7efcSopenharmony_ci
228eace7efcSopenharmony_ci  if (memory_utils_purgeable_ashmem_enable && defined(global_parts_info) &&
229eace7efcSopenharmony_ci      defined(global_parts_info.resourceschedule_memmgr_override)) {
230eace7efcSopenharmony_ci    defines += [ "IMAGE_PURGEABLE_PIXELMAP" ]
231eace7efcSopenharmony_ci    external_deps += [ "memmgr:libpurgeablemem_plugin" ]
232eace7efcSopenharmony_ci  }
233eace7efcSopenharmony_ci
234eace7efcSopenharmony_ci  if (cj_frontend) {
235eace7efcSopenharmony_ci    sources += [
236eace7efcSopenharmony_ci      "${ability_runtime_native_path}/appkit/ability_runtime/app/cj_ability_stage.cpp",
237eace7efcSopenharmony_ci      "${ability_runtime_native_path}/appkit/ability_runtime/app/cj_ability_stage_context.cpp",
238eace7efcSopenharmony_ci      "${ability_runtime_native_path}/appkit/ability_runtime/app/cj_ability_stage_object.cpp",
239eace7efcSopenharmony_ci    ]
240eace7efcSopenharmony_ci
241eace7efcSopenharmony_ci    include_dirs += [
242eace7efcSopenharmony_ci      "${ability_runtime_path}/cj_environment/interfaces/inner_api",
243eace7efcSopenharmony_ci      "${ability_runtime_path}/frameworks/cj/ffi",
244eace7efcSopenharmony_ci    ]
245eace7efcSopenharmony_ci
246eace7efcSopenharmony_ci    defines += [ "CJ_FRONTEND" ]
247eace7efcSopenharmony_ci
248eace7efcSopenharmony_ci    external_deps += [
249eace7efcSopenharmony_ci      "bundle_framework:appexecfwk_base",
250eace7efcSopenharmony_ci      "napi:cj_bind_ffi",
251eace7efcSopenharmony_ci      "napi:cj_bind_native",
252eace7efcSopenharmony_ci    ]
253eace7efcSopenharmony_ci  }
254eace7efcSopenharmony_ci
255eace7efcSopenharmony_ci  if (ability_runtime_app_no_response_dialog) {
256eace7efcSopenharmony_ci    defines += [ "APP_NO_RESPONSE_DIALOG" ]
257eace7efcSopenharmony_ci  }
258eace7efcSopenharmony_ci
259eace7efcSopenharmony_ci  cflags_cc = []
260eace7efcSopenharmony_ci  if (os_dlp_part_enabled) {
261eace7efcSopenharmony_ci    cflags_cc += [ "-DWITH_DLP" ]
262eace7efcSopenharmony_ci  }
263eace7efcSopenharmony_ci
264eace7efcSopenharmony_ci  innerapi_tags = [ "platformsdk" ]
265eace7efcSopenharmony_ci  version_script = "libappkit_native.map"
266eace7efcSopenharmony_ci  subsystem_name = "ability"
267eace7efcSopenharmony_ci  part_name = "ability_runtime"
268eace7efcSopenharmony_ci}
269eace7efcSopenharmony_ci
270eace7efcSopenharmony_ci# build so
271eace7efcSopenharmony_ciohos_shared_library("app_context") {
272eace7efcSopenharmony_ci  branch_protector_ret = "pac_ret"
273eace7efcSopenharmony_ci
274eace7efcSopenharmony_ci  include_dirs = [
275eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
276eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/app",
277eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper",
278eace7efcSopenharmony_ci  ]
279eace7efcSopenharmony_ci
280eace7efcSopenharmony_ci  configs = [ ":appkit_config" ]
281eace7efcSopenharmony_ci
282eace7efcSopenharmony_ci  public_configs = [ ":appkit_public_config" ]
283eace7efcSopenharmony_ci
284eace7efcSopenharmony_ci  sources = [
285eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_runtime/context/ability_lifecycle_callback.cpp",
286eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_runtime/context/ability_stage_context.cpp",
287eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_runtime/context/application_context.cpp",
288eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_runtime/context/application_state_change_callback.cpp",
289eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_runtime/context/context_impl.cpp",
290eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_runtime/context/environment_callback.cpp",
291eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/overlay_event_subscriber.cpp",
292eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/app/sys_mgr_client.cpp",
293eace7efcSopenharmony_ci  ]
294eace7efcSopenharmony_ci  cflags = []
295eace7efcSopenharmony_ci  if (target_cpu == "arm") {
296eace7efcSopenharmony_ci    cflags += [ "-DBINDER_IPC_32BIT" ]
297eace7efcSopenharmony_ci  }
298eace7efcSopenharmony_ci  deps = [
299eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
300eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/ability_manager:ability_start_options",
301eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/app_manager:app_manager",
302eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper",
303eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/runtime:runtime",
304eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit:appkit_manager_helper",
305eace7efcSopenharmony_ci  ]
306eace7efcSopenharmony_ci
307eace7efcSopenharmony_ci  external_deps = [
308eace7efcSopenharmony_ci    "ability_base:extractortool",
309eace7efcSopenharmony_ci    "c_utils:utils",
310eace7efcSopenharmony_ci    "common_event_service:cesfwk_innerkits",
311eace7efcSopenharmony_ci    "hilog:libhilog",
312eace7efcSopenharmony_ci    "hitrace:hitrace_meter",
313eace7efcSopenharmony_ci    "init:libbegetutil",
314eace7efcSopenharmony_ci    "ipc:ipc_core",
315eace7efcSopenharmony_ci    "json:nlohmann_json_static",
316eace7efcSopenharmony_ci    "napi:ace_napi",
317eace7efcSopenharmony_ci    "resource_management:global_resmgr",
318eace7efcSopenharmony_ci    "samgr:samgr_proxy",
319eace7efcSopenharmony_ci  ]
320eace7efcSopenharmony_ci  public_external_deps = [
321eace7efcSopenharmony_ci    "ability_base:configuration",
322eace7efcSopenharmony_ci    "ability_base:session_info",
323eace7efcSopenharmony_ci    "ability_base:want",
324eace7efcSopenharmony_ci    "bundle_framework:appexecfwk_base",
325eace7efcSopenharmony_ci    "bundle_framework:appexecfwk_core",
326eace7efcSopenharmony_ci  ]
327eace7efcSopenharmony_ci
328eace7efcSopenharmony_ci  if (ability_runtime_graphics) {
329eace7efcSopenharmony_ci    external_deps += [
330eace7efcSopenharmony_ci      "i18n:intl_util",
331eace7efcSopenharmony_ci      "icu:shared_icuuc",
332eace7efcSopenharmony_ci    ]
333eace7efcSopenharmony_ci  }
334eace7efcSopenharmony_ci
335eace7efcSopenharmony_ci  innerapi_tags = [ "platformsdk" ]
336eace7efcSopenharmony_ci  subsystem_name = "ability"
337eace7efcSopenharmony_ci  part_name = "ability_runtime"
338eace7efcSopenharmony_ci}
339eace7efcSopenharmony_ci
340eace7efcSopenharmony_ci# build so
341eace7efcSopenharmony_ciohos_shared_library("app_context_utils") {
342eace7efcSopenharmony_ci  branch_protector_ret = "pac_ret"
343eace7efcSopenharmony_ci
344eace7efcSopenharmony_ci  include_dirs = [
345eace7efcSopenharmony_ci    "${ability_runtime_napi_path}/ability_auto_startup_callback",
346eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
347eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app",
348eace7efcSopenharmony_ci  ]
349eace7efcSopenharmony_ci
350eace7efcSopenharmony_ci  configs = [ ":appkit_config" ]
351eace7efcSopenharmony_ci
352eace7efcSopenharmony_ci  public_configs = [ ":appkit_public_config" ]
353eace7efcSopenharmony_ci
354eace7efcSopenharmony_ci  sources = [
355eace7efcSopenharmony_ci    "ability_runtime/context/js_application_context_utils.cpp",
356eace7efcSopenharmony_ci    "ability_runtime/context/js_context_utils.cpp",
357eace7efcSopenharmony_ci    "ability_runtime/context/js_resource_manager_utils.cpp",
358eace7efcSopenharmony_ci  ]
359eace7efcSopenharmony_ci  cflags = []
360eace7efcSopenharmony_ci  if (target_cpu == "arm") {
361eace7efcSopenharmony_ci    cflags += [ "-DBINDER_IPC_32BIT" ]
362eace7efcSopenharmony_ci  }
363eace7efcSopenharmony_ci  deps = [
364eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
365eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/ability_manager:ability_start_options",
366eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/app_manager:app_manager",
367eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/error_utils:ability_runtime_error_util",
368eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/runtime:runtime",
369eace7efcSopenharmony_ci    "${ability_runtime_napi_path}/inner/napi_common:napi_common",
370eace7efcSopenharmony_ci    "${ability_runtime_native_path}/ability/native:ability_business_error",
371eace7efcSopenharmony_ci    "${ability_runtime_native_path}/ability/native:auto_startup_callback",
372eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit:app_context",
373eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit:application_context_manager",
374eace7efcSopenharmony_ci  ]
375eace7efcSopenharmony_ci
376eace7efcSopenharmony_ci  external_deps = [
377eace7efcSopenharmony_ci    "ability_base:session_info",
378eace7efcSopenharmony_ci    "ability_base:want",
379eace7efcSopenharmony_ci    "access_token:libtokenid_sdk",
380eace7efcSopenharmony_ci    "bundle_framework:appexecfwk_base",
381eace7efcSopenharmony_ci    "bundle_framework:appexecfwk_core",
382eace7efcSopenharmony_ci    "c_utils:utils",
383eace7efcSopenharmony_ci    "hilog:libhilog",
384eace7efcSopenharmony_ci    "hitrace:hitrace_meter",
385eace7efcSopenharmony_ci    "ipc:ipc_core",
386eace7efcSopenharmony_ci    "json:nlohmann_json_static",
387eace7efcSopenharmony_ci    "napi:ace_napi",
388eace7efcSopenharmony_ci    "resource_management:global_resmgr",
389eace7efcSopenharmony_ci    "resource_management:resmgr_napi_core",
390eace7efcSopenharmony_ci  ]
391eace7efcSopenharmony_ci  public_external_deps = [ "ability_base:configuration" ]
392eace7efcSopenharmony_ci  if (ability_runtime_graphics) {
393eace7efcSopenharmony_ci    external_deps += [
394eace7efcSopenharmony_ci      "i18n:intl_util",
395eace7efcSopenharmony_ci      "icu:shared_icuuc",
396eace7efcSopenharmony_ci    ]
397eace7efcSopenharmony_ci  }
398eace7efcSopenharmony_ci
399eace7efcSopenharmony_ci  innerapi_tags = [ "platformsdk" ]
400eace7efcSopenharmony_ci  subsystem_name = "ability"
401eace7efcSopenharmony_ci  part_name = "ability_runtime"
402eace7efcSopenharmony_ci}
403eace7efcSopenharmony_ci
404eace7efcSopenharmony_ci# build so
405eace7efcSopenharmony_ciohos_shared_library("appkit_delegator") {
406eace7efcSopenharmony_ci  branch_protector_ret = "pac_ret"
407eace7efcSopenharmony_ci
408eace7efcSopenharmony_ci  include_dirs = [
409eace7efcSopenharmony_ci    "native",
410eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app",
411eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
412eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/ability_delegator/include",
413eace7efcSopenharmony_ci    "${ability_runtime_services_path}/common/include",
414eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/ability/native",
415eace7efcSopenharmony_ci  ]
416eace7efcSopenharmony_ci
417eace7efcSopenharmony_ci  configs = [ ":appkit_config" ]
418eace7efcSopenharmony_ci
419eace7efcSopenharmony_ci  public_configs = [ ":appkit_public_config" ]
420eace7efcSopenharmony_ci
421eace7efcSopenharmony_ci  sources = [
422eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_delegator/ability_delegator.cpp",
423eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_delegator/ability_delegator_args.cpp",
424eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_delegator/ability_delegator_registry.cpp",
425eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_delegator/delegator_thread.cpp",
426eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_delegator/iability_monitor.cpp",
427eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_delegator/iability_stage_monitor.cpp",
428eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_delegator/runner_runtime/js_test_runner.cpp",
429eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_delegator/shell_cmd_result.cpp",
430eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit/ability_delegator/test_runner.cpp",
431eace7efcSopenharmony_ci    "${ability_runtime_path}/tools/aa/src/shell_command_result.cpp",
432eace7efcSopenharmony_ci    "${ability_runtime_path}/tools/aa/src/test_observer_proxy.cpp",
433eace7efcSopenharmony_ci  ]
434eace7efcSopenharmony_ci
435eace7efcSopenharmony_ci  cflags = []
436eace7efcSopenharmony_ci  if (target_cpu == "arm") {
437eace7efcSopenharmony_ci    cflags += [ "-DBINDER_IPC_32BIT" ]
438eace7efcSopenharmony_ci  }
439eace7efcSopenharmony_ci
440eace7efcSopenharmony_ci  deps = [
441eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
442eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/ability_manager:ability_start_options",
443eace7efcSopenharmony_ci    "${ability_runtime_innerkits_path}/runtime:runtime",
444eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit:app_context",
445eace7efcSopenharmony_ci    "${ability_runtime_native_path}/appkit:delegator_mgmt",
446eace7efcSopenharmony_ci  ]
447eace7efcSopenharmony_ci
448eace7efcSopenharmony_ci  external_deps = [
449eace7efcSopenharmony_ci    "ability_base:session_info",
450eace7efcSopenharmony_ci    "ability_base:want",
451eace7efcSopenharmony_ci    "bundle_framework:appexecfwk_base",
452eace7efcSopenharmony_ci    "c_utils:utils",
453eace7efcSopenharmony_ci    "common_event_service:cesfwk_innerkits",
454eace7efcSopenharmony_ci    "eventhandler:libeventhandler",
455eace7efcSopenharmony_ci    "hilog:libhilog",
456eace7efcSopenharmony_ci    "ipc:ipc_core",
457eace7efcSopenharmony_ci    "json:nlohmann_json_static",
458eace7efcSopenharmony_ci    "napi:ace_napi",
459eace7efcSopenharmony_ci  ]
460eace7efcSopenharmony_ci
461eace7efcSopenharmony_ci  public_external_deps = [ "ability_base:configuration" ]
462eace7efcSopenharmony_ci
463eace7efcSopenharmony_ci  if (cj_frontend) {
464eace7efcSopenharmony_ci    sources += [
465eace7efcSopenharmony_ci      "${ability_runtime_native_path}/appkit/ability_delegator/runner_runtime/cj_test_runner.cpp",
466eace7efcSopenharmony_ci      "${ability_runtime_native_path}/appkit/ability_delegator/runner_runtime/cj_test_runner_object.cpp",
467eace7efcSopenharmony_ci    ]
468eace7efcSopenharmony_ci
469eace7efcSopenharmony_ci    include_dirs +=
470eace7efcSopenharmony_ci        [ "${ability_runtime_path}/cj_environment/interfaces/inner_api" ]
471eace7efcSopenharmony_ci
472eace7efcSopenharmony_ci    defines = [ "CJ_FRONTEND" ]
473eace7efcSopenharmony_ci  }
474eace7efcSopenharmony_ci  if (ability_runtime_graphics) {
475eace7efcSopenharmony_ci    external_deps += [ "icu:shared_icuuc" ]
476eace7efcSopenharmony_ci  }
477eace7efcSopenharmony_ci
478eace7efcSopenharmony_ci  innerapi_tags = [ "platformsdk" ]
479eace7efcSopenharmony_ci  subsystem_name = "ability"
480eace7efcSopenharmony_ci  part_name = "ability_runtime"
481eace7efcSopenharmony_ci}
482eace7efcSopenharmony_ci
483eace7efcSopenharmony_ciconfig("application_context_manager_config") {
484eace7efcSopenharmony_ci  include_dirs = [
485eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
486eace7efcSopenharmony_ci    "${ability_runtime_services_path}/common/include",
487eace7efcSopenharmony_ci  ]
488eace7efcSopenharmony_ci}
489eace7efcSopenharmony_ci
490eace7efcSopenharmony_ciohos_shared_library("appkit_manager_helper") {
491eace7efcSopenharmony_ci  branch_protector_ret = "pac_ret"
492eace7efcSopenharmony_ci
493eace7efcSopenharmony_ci  include_dirs = [
494eace7efcSopenharmony_ci    "native",
495eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app",
496eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
497eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper",
498eace7efcSopenharmony_ci    "${ability_runtime_services_path}/common/include",
499eace7efcSopenharmony_ci    "${ability_runtime_path}/interfaces/kits/native/ability/native",
500eace7efcSopenharmony_ci    "${ability_runtime_utils_path}/global/constant",
501eace7efcSopenharmony_ci  ]
502eace7efcSopenharmony_ci
503eace7efcSopenharmony_ci  configs = [ ":appkit_config" ]
504eace7efcSopenharmony_ci
505eace7efcSopenharmony_ci  sources = [ "${ability_runtime_native_path}/appkit/ability_bundle_manager_helper/bundle_mgr_helper.cpp" ]
506eace7efcSopenharmony_ci
507eace7efcSopenharmony_ci  cflags = []
508eace7efcSopenharmony_ci  if (target_cpu == "arm") {
509eace7efcSopenharmony_ci    cflags += [ "-DBINDER_IPC_32BIT" ]
510eace7efcSopenharmony_ci  }
511eace7efcSopenharmony_ci
512eace7efcSopenharmony_ci  deps = []
513eace7efcSopenharmony_ci
514eace7efcSopenharmony_ci  external_deps = [
515eace7efcSopenharmony_ci    "ability_base:want",
516eace7efcSopenharmony_ci    "bundle_framework:appexecfwk_base",
517eace7efcSopenharmony_ci    "bundle_framework:appexecfwk_core",
518eace7efcSopenharmony_ci    "bundle_framework:libappexecfwk_common",
519eace7efcSopenharmony_ci    "c_utils:utils",
520eace7efcSopenharmony_ci    "hilog:libhilog",
521eace7efcSopenharmony_ci    "hitrace:hitrace_meter",
522eace7efcSopenharmony_ci    "ipc:ipc_core",
523eace7efcSopenharmony_ci    "json:nlohmann_json_static",
524eace7efcSopenharmony_ci    "samgr:samgr_proxy",
525eace7efcSopenharmony_ci  ]
526eace7efcSopenharmony_ci
527eace7efcSopenharmony_ci  if (ability_runtime_graphics) {
528eace7efcSopenharmony_ci    external_deps += [ "icu:shared_icuuc" ]
529eace7efcSopenharmony_ci  }
530eace7efcSopenharmony_ci
531eace7efcSopenharmony_ci  innerapi_tags = [ "platformsdk" ]
532eace7efcSopenharmony_ci  subsystem_name = "ability"
533eace7efcSopenharmony_ci  part_name = "ability_runtime"
534eace7efcSopenharmony_ci}
535eace7efcSopenharmony_ci
536eace7efcSopenharmony_ciohos_shared_library("application_context_manager") {
537eace7efcSopenharmony_ci  branch_protector_ret = "pac_ret"
538eace7efcSopenharmony_ci
539eace7efcSopenharmony_ci  sources = [ "${ability_runtime_native_path}/appkit/ability_runtime/context/application_context_manager.cpp" ]
540eace7efcSopenharmony_ci
541eace7efcSopenharmony_ci  cflags = []
542eace7efcSopenharmony_ci  if (target_cpu == "arm") {
543eace7efcSopenharmony_ci    cflags += [ "-DBINDER_IPC_32BIT" ]
544eace7efcSopenharmony_ci  }
545eace7efcSopenharmony_ci
546eace7efcSopenharmony_ci  external_deps = [
547eace7efcSopenharmony_ci    "ets_runtime:libark_jsruntime",
548eace7efcSopenharmony_ci    "hilog:libhilog",
549eace7efcSopenharmony_ci    "napi:ace_napi",
550eace7efcSopenharmony_ci  ]
551eace7efcSopenharmony_ci
552eace7efcSopenharmony_ci  public_configs = [ ":application_context_manager_config" ]
553eace7efcSopenharmony_ci
554eace7efcSopenharmony_ci  subsystem_name = "ability"
555eace7efcSopenharmony_ci  part_name = "ability_runtime"
556eace7efcSopenharmony_ci}
557