• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2024 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("//build/templates/abc/ohos_abc.gni")
16import("//foundation/arkui/ace_engine/ace_config.gni")
17import("//foundation/arkui/ace_engine/build/ace_ext.gni")
18import("//foundation/arkui/ace_engine/build/ace_gen_obj.gni")
19import(
20    "//foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/state_mgmt/files_to_watch.gni")
21
22# declarative frontend source
23template("declarative_frontend") {
24  forward_variables_from(invoker, "*")
25  platform = invoker.platform
26
27  ohos_source_set(target_name) {
28    subsystem_name = ace_engine_subsystem
29    part_name = ace_engine_part
30    defines += invoker.defines
31    defines += [ "USE_ARK_ENGINE" ]
32    configs = [ "$ace_root:ace_config" ]
33
34    include_dirs = [
35      "$ace_napi_frameworks/bridge/declarative_frontend/engine/jsi",
36      "$ace_root",
37    ]
38    if (platform == "ohos_ng" || is_arkui_x) {
39      sources = [
40        "ng/declarative_frontend_ng.cpp",
41        "ng/frontend_delegate_declarative_ng.cpp",
42        "ng/page_router_manager.cpp",
43      ]
44    } else {
45      sources = [
46        "declarative_frontend.cpp",
47        "frontend_delegate_declarative.cpp",
48        "ng/page_router_manager.cpp",
49      ]
50    }
51
52    if (ace_engine_feature_enable_split_mode &&
53        defined(vendor_configs.ace_engine_advanced_split_mode_dirs)) {
54      include_dirs += vendor_configs.ace_engine_advanced_split_mode_dirs
55    }
56
57    if (ace_engine_feature_enable_split_mode &&
58        defined(vendor_configs.ace_engine_advanced_split_mode_bridge)) {
59      sources += vendor_configs.ace_engine_advanced_split_mode_bridge
60    } else {
61      sources += [ "ng/page_router_manager_factory.cpp" ]
62    }
63
64    deps = [ "$ace_root/frameworks/core/components/theme:build_theme_code" ]
65    if (is_arkui_x) {
66      deps += [
67        "//arkcompiler/ets_runtime:libark_jsruntime_static",
68        "//foundation/arkui/napi:ace_napi",
69      ]
70    }
71    external_deps = [
72      "ets_runtime:libark_jsruntime",
73      "napi:ace_napi",
74    ]
75    if (use_hilog) {
76      external_deps += [ "hilog:libhilog" ]
77    }
78  }
79}
80
81foreach(item, ace_platforms) {
82  platform = item.name
83  declarative_frontend("declarative_frontend_" + item.name) {
84    defines = []
85    config = {
86    }
87
88    if (defined(item.config)) {
89      config = item.config
90    }
91
92    if (defined(config.defines)) {
93      defines = config.defines
94    }
95  }
96}
97
98# js resources objects
99base_output_path = get_label_info(":gen_js_proxyclass", "target_out_dir")
100jsproxyclass_obj_path = base_output_path + "/js_proxy_class.o"
101jsenumstyle_obj_path = base_output_path + "/js_enum_style.o"
102jsmocksystemplugin_obj_path = base_output_path + "/js_mock_system_plugin.o"
103ark_theme_obj_path = base_output_path + "/arkTheme.o"
104jsuicontext_obj_path = base_output_path + "/jsUIContext.o"
105arkcomponent_obj_path = base_output_path + "/arkComponent.o"
106
107action("run_state_mgmt_build") {
108  script = "state_mgmt/build.py"
109  inputs = state_mgmt_release_files_to_watch
110  outputs = [ "$target_out_dir/stateMgmt.js" ]
111  args = [
112    # Paths: 1 StateMgmt root folder. 2. Folder to check need of npm install. 3. stateMgmt.js output path.
113    rebase_path("$ace_root/frameworks/bridge/declarative_frontend/state_mgmt"),
114    rebase_path(
115        "$ace_root/frameworks/bridge/declarative_frontend/state_mgmt/node_modules"),
116    rebase_path("$target_out_dir"),
117    "--release",
118  ]
119}
120
121gen_obj("js_proxyclass") {
122  input = "$target_out_dir/stateMgmt.js"
123  if (use_mac || use_mingw_win || use_linux || target_os == "ios") {
124    jsproxyclass_obj_path = base_output_path + "/js_proxy_class.c"
125  }
126  output = jsproxyclass_obj_path
127  snapshot_dep = [ ":run_state_mgmt_build" ]
128}
129
130gen_obj("js_enum_style") {
131  input = "engine/jsEnumStyle.js"
132  if (use_mac || use_mingw_win || use_linux || target_os == "ios") {
133    jsenumstyle_obj_path = base_output_path + "/js_enum_style.c"
134  }
135  output = jsenumstyle_obj_path
136  snapshot_dep = []
137}
138
139gen_obj("ark_theme") {
140  input = "engine/arkTheme.js"
141  if (use_mac || use_mingw_win || use_linux || target_os == "ios") {
142    ark_theme_obj_path = base_output_path + "/ark_theme.c"
143  }
144  output = ark_theme_obj_path
145  snapshot_dep = []
146}
147
148gen_obj("ark_component") {
149  input = "engine/arkComponent.js"
150  if (use_mac || use_mingw_win || use_linux || target_os == "ios") {
151    arkcomponent_obj_path = base_output_path + "/ark_component.c"
152  }
153  output = arkcomponent_obj_path
154  snapshot_dep = []
155}
156
157if (!is_arkui_x && (use_mac || use_mingw_win || use_linux)) {
158  gen_obj("js_mock_system_plugin") {
159    input = "$root_out_dir/obj/ide/tools/previewer/automock/dist/jsMockSystemPlugin.js"
160    if (use_mac || use_mingw_win || use_linux || target_os == "ios") {
161      jsmocksystemplugin_obj_path =
162          base_output_path + "/js_mock_system_plugin.c"
163    }
164    output = jsmocksystemplugin_obj_path
165    snapshot_dep = [ "//ide/tools/previewer/automock:gen_snapshot_jsmock" ]
166  }
167}
168
169gen_obj("js_uicontext") {
170  input = "engine/jsUIContext.js"
171  if (use_mac || use_mingw_win || use_linux || target_os == "ios") {
172    jsuicontext_obj_path = base_output_path + "/jsUIContext.c"
173  }
174  output = jsuicontext_obj_path
175  snapshot_dep = []
176}
177
178# build declarative javascript engine source
179template("declarative_js_engine") {
180  forward_variables_from(invoker, "*")
181
182  ohos_source_set(target_name) {
183    subsystem_name = ace_engine_subsystem
184    part_name = ace_engine_part
185    defines += invoker.defines
186    if (target_cpu == "arm64") {
187      if (!is_mingw) {
188        defines += [ "_ARM64_" ]
189      }
190    }
191    if (current_os == "ohos" && current_cpu == "x86_64") {
192      defines += [ "SIMULATOR_64" ]
193    }
194
195    deps = [
196      ":ark_modifier",
197      ":ark_theme_control",
198      ":gen_obj_src_ark_component",
199      ":gen_obj_src_ark_theme",
200      ":gen_obj_src_js_enum_style",
201      ":gen_obj_src_js_proxyclass",
202      ":mock",
203      ":prefetcher",
204      ":shape",
205      ":statemanagement",
206      ":x_node",
207      "engine/$engine_path:declarative_js_engine_bridge_${engine_name}_$platform",
208    ]
209
210    if (!is_arkui_x) {
211      deps += [ ":uicontext" ]
212    } else {
213      deps += [ ":gen_obj_src_js_uicontext" ]
214    }
215
216    configs = [ "$ace_root:ace_config" ]
217    if (ace_engine_feature_enable_point_light) {
218      defines += [ "POINT_LIGHT_ENABLE" ]
219    }
220
221    sources = [
222      "engine/bindings_implementation.cpp",
223      "engine/declarative_engine_loader.cpp",
224      "engine/functions/js_animator_function.cpp",
225      "engine/functions/js_click_function.cpp",
226      "engine/functions/js_clipboard_function.cpp",
227      "engine/functions/js_drag_function.cpp",
228      "engine/functions/js_focus_function.cpp",
229      "engine/functions/js_foreach_function.cpp",
230      "engine/functions/js_function.cpp",
231      "engine/functions/js_gesture_function.cpp",
232      "engine/functions/js_gesture_judge_function.cpp",
233      "engine/functions/js_gesture_recognizer.cpp",
234      "engine/functions/js_hover_function.cpp",
235      "engine/functions/js_key_function.cpp",
236      "engine/functions/js_mouse_function.cpp",
237      "engine/functions/js_navigation_function.cpp",
238      "engine/functions/js_on_area_change_function.cpp",
239      "engine/functions/js_on_child_touch_test_function.cpp",
240      "engine/functions/js_on_size_change_function.cpp",
241      "engine/functions/js_page_transition_function.cpp",
242      "engine/functions/js_pan_function.cpp",
243      "engine/functions/js_should_built_in_recognizer_parallel_with_function.cpp",
244      "engine/functions/js_swiper_function.cpp",
245      "engine/functions/js_tabs_function.cpp",
246      "engine/functions/js_touch_function.cpp",
247      "engine/functions/js_touch_intercept_function.cpp",
248      "engine/functions/js_webview_function.cpp",
249      "engine/js_types.cpp",
250      "interfaces/profiler/js_profiler.cpp",
251      "jsview/action_sheet/js_action_sheet.cpp",
252      "jsview/canvas/js_canvas.cpp",
253      "jsview/canvas/js_canvas_gradient.cpp",
254      "jsview/canvas/js_canvas_image_data.cpp",
255      "jsview/canvas/js_canvas_path.cpp",
256      "jsview/canvas/js_canvas_pattern.cpp",
257      "jsview/canvas/js_canvas_renderer.cpp",
258      "jsview/canvas/js_drawing_rendering_context.cpp",
259      "jsview/canvas/js_matrix2d.cpp",
260      "jsview/canvas/js_offscreen_canvas.cpp",
261      "jsview/canvas/js_offscreen_rendering_context.cpp",
262      "jsview/canvas/js_path2d.cpp",
263      "jsview/canvas/js_render_image.cpp",
264      "jsview/canvas/js_rendering_context.cpp",
265      "jsview/canvas/js_rendering_context_settings.cpp",
266      "jsview/dialog/js_alert_dialog.cpp",
267      "jsview/dialog/js_custom_dialog_controller.cpp",
268      "jsview/js_accessibility.cpp",
269      "jsview/js_animator.cpp",
270      "jsview/js_app_bar_view.cpp",
271      "jsview/js_badge.cpp",
272      "jsview/js_base_node.cpp",
273      "jsview/js_blank.cpp",
274      "jsview/js_button.cpp",
275      "jsview/js_calendar.cpp",
276      "jsview/js_calendar_controller.cpp",
277      "jsview/js_calendar_picker.cpp",
278      "jsview/js_checkbox.cpp",
279      "jsview/js_checkboxgroup.cpp",
280      "jsview/js_circle.cpp",
281      "jsview/js_circle_shape.cpp",
282      "jsview/js_clipboard.cpp",
283      "jsview/js_column.cpp",
284      "jsview/js_common_view.cpp",
285      "jsview/js_container_base.cpp",
286      "jsview/js_container_modal_view.cpp",
287      "jsview/js_container_span.cpp",
288      "jsview/js_content_slot.cpp",
289      "jsview/js_counter.cpp",
290      "jsview/js_data_panel.cpp",
291      "jsview/js_datepicker.cpp",
292      "jsview/js_divider.cpp",
293      "jsview/js_dump_log.cpp",
294      "jsview/js_ellipse.cpp",
295      "jsview/js_ellipse_shape.cpp",
296      "jsview/js_environment.cpp",
297      "jsview/js_flex.cpp",
298      "jsview/js_flex_impl.cpp",
299      "jsview/js_foreach.cpp",
300      "jsview/js_form_link.cpp",
301      "jsview/js_gauge.cpp",
302      "jsview/js_gesture.cpp",
303      "jsview/js_grid.cpp",
304      "jsview/js_grid_col.cpp",
305      "jsview/js_grid_container.cpp",
306      "jsview/js_grid_item.cpp",
307      "jsview/js_grid_row.cpp",
308      "jsview/js_hyperlink.cpp",
309      "jsview/js_if_else.cpp",
310      "jsview/js_image.cpp",
311      "jsview/js_image_animator.cpp",
312      "jsview/js_image_span.cpp",
313      "jsview/js_indexer.cpp",
314      "jsview/js_indicator.cpp",
315      "jsview/js_interactable_view.cpp",
316      "jsview/js_keyboard_avoid.cpp",
317      "jsview/js_layout_manager.cpp",
318      "jsview/js_layoutable_view.cpp",
319      "jsview/js_lazy_foreach.cpp",
320      "jsview/js_lazy_grid.cpp",
321      "jsview/js_line.cpp",
322      "jsview/js_linear_gradient.cpp",
323      "jsview/js_linear_indicator.cpp",
324      "jsview/js_linear_indicator_controller.cpp",
325      "jsview/js_list.cpp",
326      "jsview/js_list_item.cpp",
327      "jsview/js_list_item_group.cpp",
328      "jsview/js_loading_progress.cpp",
329      "jsview/js_local_storage.cpp",
330      "jsview/js_location_button.cpp",
331      "jsview/js_marquee.cpp",
332      "jsview/js_menu.cpp",
333      "jsview/js_menu_item.cpp",
334      "jsview/js_menu_item_group.cpp",
335      "jsview/js_mock.cpp",
336      "jsview/js_nav_path_stack.cpp",
337      "jsview/js_navdestination.cpp",
338      "jsview/js_navdestination_context.cpp",
339      "jsview/js_navdestination_scrollable_processor.cpp",
340      "jsview/js_navigation.cpp",
341      "jsview/js_navigation_stack.cpp",
342      "jsview/js_navigation_utils.cpp",
343      "jsview/js_navigator.cpp",
344      "jsview/js_navrouter.cpp",
345      "jsview/js_node_container.cpp",
346      "jsview/js_page_transition.cpp",
347      "jsview/js_pan_handler.cpp",
348      "jsview/js_particle.cpp",
349      "jsview/js_paste_button.cpp",
350      "jsview/js_path.cpp",
351      "jsview/js_path_shape.cpp",
352      "jsview/js_pattern_lock.cpp",
353      "jsview/js_persistent.cpp",
354      "jsview/js_polygon.cpp",
355      "jsview/js_polyline.cpp",
356      "jsview/js_popups.cpp",
357      "jsview/js_progress.cpp",
358      "jsview/js_radio.cpp",
359      "jsview/js_rect.cpp",
360      "jsview/js_rect_shape.cpp",
361      "jsview/js_recycle_view.cpp",
362      "jsview/js_refresh.cpp",
363      "jsview/js_relative_container.cpp",
364      "jsview/js_repeat.cpp",
365      "jsview/js_repeat_virtual_scroll.cpp",
366      "jsview/js_richeditor.cpp",
367      "jsview/js_row.cpp",
368      "jsview/js_save_button.cpp",
369      "jsview/js_scope_util.cpp",
370      "jsview/js_scroll.cpp",
371      "jsview/js_scrollable.cpp",
372      "jsview/js_scrollable_base.cpp",
373      "jsview/js_scroller.cpp",
374      "jsview/js_search.cpp",
375      "jsview/js_sec_button_base.cpp",
376      "jsview/js_shape.cpp",
377      "jsview/js_shape_abstract.cpp",
378      "jsview/js_sheet.cpp",
379      "jsview/js_side_bar.cpp",
380      "jsview/js_slider.cpp",
381      "jsview/js_sliding_panel.cpp",
382      "jsview/js_span.cpp",
383      "jsview/js_stack.cpp",
384      "jsview/js_state_mgmt_profiler.cpp",
385      "jsview/js_swiper.cpp",
386      "jsview/js_symbol.cpp",
387      "jsview/js_symbol_span.cpp",
388      "jsview/js_tab_content.cpp",
389      "jsview/js_tabs.cpp",
390      "jsview/js_tabs_controller.cpp",
391      "jsview/js_tabs_feature.cpp",
392      "jsview/js_text.cpp",
393      "jsview/js_text_clock.cpp",
394      "jsview/js_text_editable_controller.cpp",
395      "jsview/js_textarea.cpp",
396      "jsview/js_textfield.cpp",
397      "jsview/js_textinput.cpp",
398      "jsview/js_textpicker.cpp",
399      "jsview/js_texttimer.cpp",
400      "jsview/js_toggle.cpp",
401      "jsview/js_touch_handler.cpp",
402      "jsview/js_utils.cpp",
403      "jsview/js_view.cpp",
404      "jsview/js_view_abstract.cpp",
405      "jsview/js_view_abstract_bridge.cpp",
406      "jsview/js_view_context.cpp",
407      "jsview/js_view_functions.cpp",
408      "jsview/js_view_measure_layout.cpp",
409      "jsview/js_view_stack_processor.cpp",
410      "jsview/js_water_flow.cpp",
411      "jsview/js_water_flow_item.cpp",
412      "jsview/js_water_flow_sections.cpp",
413      "jsview/menu/js_context_menu.cpp",
414      "jsview/scroll_bar/js_scroll_bar.cpp",
415      "jsview/text_menu/js_text_menu.cpp",
416      "sharedata/js_share_data.cpp",
417      "style_string/js_span_object.cpp",
418      "style_string/js_span_string.cpp",
419      "view_stack_processor.cpp",
420
421      # ark_theme
422      "ark_theme/theme_apply/js_with_theme.cpp",
423
424      # Models implemenations for classic fw
425      "jsview/models/action_sheet_model_impl.cpp",
426      "jsview/models/alert_dialog_model_impl.cpp",
427      "jsview/models/animator_model_impl.cpp",
428      "jsview/models/badge_model_impl.cpp",
429      "jsview/models/blank_model_impl.cpp",
430      "jsview/models/button_model_impl.cpp",
431      "jsview/models/calendar_controller_model_impl.cpp",
432      "jsview/models/calendar_model_impl.cpp",
433      "jsview/models/canvas/canvas_model_impl.cpp",
434      "jsview/models/canvas/canvas_rendering_context_2d_model_impl.cpp",
435      "jsview/models/canvas/offscreen_canvas_rendering_context_2d_model_impl.cpp",
436      "jsview/models/checkbox_model_impl.cpp",
437      "jsview/models/checkboxgroup_model_impl.cpp",
438      "jsview/models/circle_model_impl.cpp",
439      "jsview/models/column_model_impl.cpp",
440      "jsview/models/common_view_model_impl.cpp",
441      "jsview/models/counter_model_impl.cpp",
442      "jsview/models/custom_dialog_controller_model_impl.cpp",
443      "jsview/models/data_panel_model_impl.cpp",
444      "jsview/models/divider_model_impl.cpp",
445      "jsview/models/ellipse_model_impl.cpp",
446      "jsview/models/flex_model_impl.cpp",
447      "jsview/models/for_each_model_impl.cpp",
448      "jsview/models/gauge_model_impl.cpp",
449      "jsview/models/gesture_model_impl.cpp",
450      "jsview/models/grid_col_model_impl.cpp",
451      "jsview/models/grid_container_model_impl.cpp",
452      "jsview/models/grid_item_model_impl.cpp",
453      "jsview/models/grid_model_impl.cpp",
454      "jsview/models/grid_row_model_impl.cpp",
455      "jsview/models/hyperlink_model_impl.cpp",
456      "jsview/models/if_else_model_impl.cpp",
457      "jsview/models/image_animator_model_impl.cpp",
458      "jsview/models/image_model_impl.cpp",
459      "jsview/models/indexer_model_impl.cpp",
460      "jsview/models/lazy_for_each_model_impl.cpp",
461      "jsview/models/line_model_impl.cpp",
462      "jsview/models/list_item_group_model_impl.cpp",
463      "jsview/models/list_item_model_impl.cpp",
464      "jsview/models/list_model_impl.cpp",
465      "jsview/models/loading_progress_model_impl.cpp",
466      "jsview/models/marquee_model_impl.cpp",
467      "jsview/models/menu_item_model_impl.cpp",
468      "jsview/models/menu_model_impl.cpp",
469      "jsview/models/navigation_model_impl.cpp",
470      "jsview/models/navigator_model_impl.cpp",
471      "jsview/models/page_transition_model_impl.cpp",
472      "jsview/models/path_model_impl.cpp",
473      "jsview/models/patternlock_model_impl.cpp",
474      "jsview/models/picker_model_impl.cpp",
475      "jsview/models/polygon_model_impl.cpp",
476      "jsview/models/progress_model_impl.cpp",
477      "jsview/models/radio_model_impl.cpp",
478      "jsview/models/rect_model_impl.cpp",
479      "jsview/models/refresh_model_impl.cpp",
480      "jsview/models/relative_container_model_impl.cpp",
481      "jsview/models/richeditor_model_impl.cpp",
482      "jsview/models/row_model_impl.cpp",
483      "jsview/models/scroll_bar_model_impl.cpp",
484      "jsview/models/scroll_model_impl.cpp",
485      "jsview/models/search_model_impl.cpp",
486      "jsview/models/shape_abstract_model_impl.cpp",
487      "jsview/models/shape_model_impl.cpp",
488      "jsview/models/side_bar_container_model_impl.cpp",
489      "jsview/models/slider_model_impl.cpp",
490      "jsview/models/sliding_panel_model_impl.cpp",
491      "jsview/models/span_model_impl.cpp",
492      "jsview/models/stack_model_impl.cpp",
493      "jsview/models/swiper_model_impl.cpp",
494      "jsview/models/tab_content_model_impl.cpp",
495      "jsview/models/tabs_model_impl.cpp",
496      "jsview/models/text_clock_model_impl.cpp",
497      "jsview/models/text_field_model_impl.cpp",
498      "jsview/models/text_model_impl.cpp",
499      "jsview/models/text_timer_model_impl.cpp",
500      "jsview/models/textpicker_model_impl.cpp",
501      "jsview/models/timepicker_model_impl.cpp",
502      "jsview/models/toggle_model_impl.cpp",
503      "jsview/models/view_abstract_model_impl.cpp",
504      "jsview/models/view_context_model_impl.cpp",
505      "jsview/models/view_full_update_model_impl.cpp",
506      "jsview/models/view_partial_update_model_impl.cpp",
507      "jsview/models/water_flow_item_model_impl.cpp",
508      "jsview/models/water_flow_model_impl.cpp",
509    ]
510
511    if (!ace_engine_feature_wearable) {
512      sources += [
513        "jsview/js_column_split.cpp",
514        "jsview/js_folder_stack.cpp",
515        "jsview/js_row_split.cpp",
516        "jsview/js_select.cpp",
517        "jsview/js_stepper.cpp",
518        "jsview/js_stepper_item.cpp",
519        "jsview/models/linear_split_model_impl.cpp",
520        "jsview/models/select_model_impl.cpp",
521        "jsview/models/stepper_item_model_impl.cpp",
522        "jsview/models/stepper_model_impl.cpp",
523      ]
524    }
525
526    if (ace_engine_feature_enable_digital_crown) {
527      sources += [ "engine/functions/js_crown_function.cpp" ]
528    }
529
530    if (qrcodegen_support) {
531      sources += [
532        "jsview/js_qrcode.cpp",
533        "jsview/models/qrcode_model_impl.cpp",
534      ]
535    }
536
537    external_deps = [ "graphic_2d:drawing_napi_impl" ]
538    if (use_hilog) {
539      external_deps += [ "hilog:libhilog" ]
540    }
541    if (defined(config.enable_drag_framework) && config.enable_drag_framework &&
542        defined(global_parts_info.distributeddatamgr_udmf)) {
543      external_deps += [
544        "udmf:udmf_client",
545        "udmf:udmf_data_napi",
546      ]
547    }
548    if (is_ohos_standard_system && !build_ohos_sdk) {
549      sources += [ "jsview/js_form_button.cpp" ]
550    }
551
552    # rich components needed by phone and TV. wearable like watch do not need them
553    if (defined(config.rich_components_support) &&
554        config.rich_components_support) {
555      sources += [
556        "jsview/js_camera.cpp",
557        "jsview/js_piece.cpp",
558        "jsview/js_rating.cpp",
559        "jsview/models/rating_model_impl.cpp",
560      ]
561      if (defined(config.video_components_support) &&
562          config.video_components_support) {
563        sources += [
564          "jsview/js_video.cpp",
565          "jsview/js_video_controller.cpp",
566          "jsview/models/video_model_impl.cpp",
567        ]
568      }
569      if (defined(config.video_support_jsstack) &&
570          config.video_support_jsstack) {
571        external_deps += [ "hiview:libxpower_event_js" ]
572      }
573    }
574
575    include_dirs = []
576    if (defined(vendor_configs.ace_engine_advanced)) {
577      include_dirs += vendor_configs.ace_advance_dirs
578      sources += vendor_configs.ace_engine_advanced_jsview
579    } else {
580      sources += [ "jsview/js_cached_image.cpp" ]
581    }
582
583    if (defined(config.xcomponent_components_support) &&
584        config.xcomponent_components_support) {
585      sources += [
586        "jsview/js_xcomponent.cpp",
587        "jsview/js_xcomponent_controller.cpp",
588        "jsview/models/xcomponent_model_impl.cpp",
589      ]
590    }
591
592    if (defined(config.enable_ability_component) &&
593        config.enable_ability_component) {
594      sources += [
595        "jsview/js_ability_component.cpp",
596        "jsview/js_ability_component_controller.cpp",
597        "jsview/models/ability_component_model_impl.cpp",
598      ]
599
600      external_deps += [
601        "input:libmmi-client",
602        "window_manager:scene_session",
603      ]
604    }
605
606    if (defined(config.web_components_support) &&
607        config.web_components_support) {
608      if (is_arkui_x) {
609        sources += [
610          "jsview/js_web.cpp",
611          "jsview/models/web_model_impl.cpp",
612        ]
613      } else {
614        sources += [
615          "jsview/js_richtext.cpp",
616          "jsview/js_web.cpp",
617          "jsview/js_web_controller.cpp",
618          "jsview/models/richtext_model_impl.cpp",
619          "jsview/models/web_model_impl.cpp",
620        ]
621      }
622    }
623
624    if (defined(config.form_components_support) &&
625        config.form_components_support) {
626      sources += [
627        "jsview/js_form.cpp",
628        "jsview/js_form_menu_item.cpp",
629        "jsview/models/form_model_impl.cpp",
630      ]
631    }
632
633    if (defined(config.remote_window_support) && config.remote_window_support) {
634      sources += [
635        "jsview/js_remote_window.cpp",
636        "jsview/models/remote_window_model_impl.cpp",
637      ]
638    }
639
640    if (defined(config.effect_component_support) &&
641        config.effect_component_support) {
642      sources += [
643        "jsview/js_effect_component.cpp",
644        "jsview/models/effect_component_model_impl.cpp",
645      ]
646    }
647
648    if (defined(config.plugin_components_support) &&
649        config.plugin_components_support) {
650      sources += [
651        "jsview/js_plugin.cpp",
652        "jsview/models/plugin_model_impl.cpp",
653      ]
654    }
655
656    if (defined(config.preview_support) && config.preview_support) {
657      sources += [ "jsview/js_previewer_mock.cpp" ]
658    }
659
660    if (defined(config.model_component_support) &&
661        config.model_component_support) {
662      sources += [ "jsview/js_sceneview.cpp" ]
663      external_deps += [ "graphic_3d:lib3dWidgetAdapter" ]
664    }
665
666    if (defined(config.use_build_in_js_engine) &&
667        config.use_build_in_js_engine) {
668      deps += [ "$ace_root/frameworks/bridge:framework_bridge_$platform" ]
669      defines += [ "BUILT_IN_JS_ENGINE" ]
670    } else {
671      sources += [
672        "$ace_root/frameworks/bridge/js_frontend/engine/common/js_engine.cpp",
673      ]
674      deps += [ "$ace_root/build:libace_compatible" ]
675      if (defined(config.build_container_scope_lib) &&
676          config.build_container_scope_lib) {
677        if (is_arkui_x) {
678          deps += [ "$ace_root/frameworks/core:ace_container_scope_static" ]
679        } else {
680          deps += [ "$ace_root/frameworks/core:ace_container_scope" ]
681        }
682      }
683    }
684
685    # add for cross_platfrom_build temporarily, shall be removed after external_deps is supported
686    if (is_arkui_x) {
687      configs += [ "$ark_ets_path:ark_jsruntime_public_config" ]
688      deps += [
689        "$ace_graphic/rosen/modules/render_service_base:librender_service_base_static",
690        "$ark_ets_path:libark_jsruntime_static",
691      ]
692      if (defined(config.pixel_map_support) && config.pixel_map_support) {
693        configs += [ "//foundation/multimedia/image_framework/interfaces/innerkits:image_external_config" ]
694      }
695    } else {
696      external_deps += [
697        "ets_runtime:libark_jsruntime",
698        "graphic_2d:librender_service_client",
699        "napi:ace_napi",
700      ]
701    }
702
703    if (platform == "windows" || platform == "mac" || platform == "linux") {
704      deps += [ ":gen_obj_src_js_mock_system_plugin" ]
705    } else {
706      if (defined(config.plugin_components_support) &&
707          config.plugin_components_support) {
708        if (!use_mingw_win && !use_mac && !use_linux) {
709          external_deps += [
710            "image_framework:image",
711            "image_framework:image_native",
712          ]
713        }
714      } else {
715        external_deps += [
716          "image_framework:image",
717          "image_framework:image_native",
718        ]
719      }
720
721      if (defined(config.window_scene_support) && config.window_scene_support) {
722        sources += [
723          "jsview/js_embedded_component.cpp",
724          "jsview/js_security_ui_extension.cpp",
725          "jsview/js_ui_extension.cpp",
726          "jsview/window_scene/js_root_scene.cpp",
727          "jsview/window_scene/js_screen.cpp",
728          "jsview/window_scene/js_window_scene.cpp",
729        ]
730
731        if (defined(config.dynamic_component_support) &&
732            config.dynamic_component_support && !build_ohos_sdk) {
733          external_deps += [ "ets_utils:worker" ]
734          sources += [
735            "jsview/js_dynamic_component.cpp",
736            "jsview/js_isolated_component.cpp",
737          ]
738        }
739      }
740    }
741  }
742}
743
744# build ng declarative javascript engine source
745template("declarative_js_engine_ng") {
746  forward_variables_from(invoker, "*")
747
748  ohos_source_set(target_name) {
749    subsystem_name = ace_engine_subsystem
750    part_name = ace_engine_part
751    defines += invoker.defines
752    if (target_cpu == "arm64") {
753      if (!is_mingw) {
754        defines += [ "_ARM64_" ]
755      }
756    }
757    if (current_os == "ohos" && current_cpu == "x86_64") {
758      defines += [ "SIMULATOR_64" ]
759    }
760
761    deps = [
762      ":ark_modifier",
763      ":ark_theme_control",
764      ":gen_obj_src_ark_component",
765      ":gen_obj_src_ark_theme",
766      ":gen_obj_src_js_enum_style",
767      ":gen_obj_src_js_proxyclass",
768      ":mock",
769      ":prefetcher",
770      ":shape",
771      ":statemanagement",
772      ":x_node",
773      "engine/$engine_path:declarative_js_engine_bridge_${engine_name}_$platform",
774    ]
775
776    if (!is_arkui_x) {
777      deps += [ ":uicontext" ]
778    } else {
779      deps += [ ":gen_obj_src_js_uicontext" ]
780    }
781
782    configs = [ "$ace_root:ace_config" ]
783
784    sources = [
785      "engine/bindings_implementation.cpp",
786      "engine/declarative_engine_loader.cpp",
787      "engine/functions/js_animator_function.cpp",
788      "engine/functions/js_click_function.cpp",
789      "engine/functions/js_clipboard_function.cpp",
790      "engine/functions/js_drag_function.cpp",
791      "engine/functions/js_focus_function.cpp",
792      "engine/functions/js_foreach_function.cpp",
793      "engine/functions/js_function.cpp",
794      "engine/functions/js_gesture_function.cpp",
795      "engine/functions/js_gesture_judge_function.cpp",
796      "engine/functions/js_gesture_recognizer.cpp",
797      "engine/functions/js_hover_function.cpp",
798      "engine/functions/js_key_function.cpp",
799      "engine/functions/js_mouse_function.cpp",
800      "engine/functions/js_navigation_function.cpp",
801      "engine/functions/js_on_area_change_function.cpp",
802      "engine/functions/js_on_child_touch_test_function.cpp",
803      "engine/functions/js_on_size_change_function.cpp",
804      "engine/functions/js_page_transition_function.cpp",
805      "engine/functions/js_pan_function.cpp",
806      "engine/functions/js_should_built_in_recognizer_parallel_with_function.cpp",
807      "engine/functions/js_swiper_function.cpp",
808      "engine/functions/js_tabs_function.cpp",
809      "engine/functions/js_touch_function.cpp",
810      "engine/functions/js_touch_intercept_function.cpp",
811      "engine/functions/js_webview_function.cpp",
812      "engine/js_types.cpp",
813      "jsview/js_dump_log.cpp",
814      "jsview/js_environment.cpp",
815      "jsview/js_local_storage.cpp",
816      "jsview/js_persistent.cpp",
817      "jsview/js_state_mgmt_profiler.cpp",
818      "jsview/js_view_functions.cpp",
819      "jsview/js_view_measure_layout.cpp",
820      "jsview/js_view_stack_processor.cpp",
821      "sharedata/js_share_data.cpp",
822
823      # jsviews
824      "interfaces/profiler/js_profiler.cpp",
825      "jsview/action_sheet/js_action_sheet.cpp",
826      "jsview/canvas/js_canvas.cpp",
827      "jsview/canvas/js_canvas_gradient.cpp",
828      "jsview/canvas/js_canvas_image_data.cpp",
829      "jsview/canvas/js_canvas_path.cpp",
830      "jsview/canvas/js_canvas_pattern.cpp",
831      "jsview/canvas/js_canvas_renderer.cpp",
832      "jsview/canvas/js_drawing_rendering_context.cpp",
833      "jsview/canvas/js_matrix2d.cpp",
834      "jsview/canvas/js_offscreen_canvas.cpp",
835      "jsview/canvas/js_offscreen_rendering_context.cpp",
836      "jsview/canvas/js_path2d.cpp",
837      "jsview/canvas/js_render_image.cpp",
838      "jsview/canvas/js_rendering_context.cpp",
839      "jsview/canvas/js_rendering_context_settings.cpp",
840      "jsview/dialog/js_alert_dialog.cpp",
841      "jsview/dialog/js_custom_dialog_controller.cpp",
842      "jsview/js_accessibility.cpp",
843      "jsview/js_animator.cpp",
844      "jsview/js_app_bar_view.cpp",
845      "jsview/js_badge.cpp",
846      "jsview/js_base_node.cpp",
847      "jsview/js_blank.cpp",
848      "jsview/js_button.cpp",
849      "jsview/js_calendar.cpp",
850      "jsview/js_calendar_controller.cpp",
851      "jsview/js_calendar_picker.cpp",
852      "jsview/js_checkbox.cpp",
853      "jsview/js_checkboxgroup.cpp",
854      "jsview/js_circle.cpp",
855      "jsview/js_circle_shape.cpp",
856      "jsview/js_clipboard.cpp",
857      "jsview/js_column.cpp",
858      "jsview/js_common_view.cpp",
859      "jsview/js_container_base.cpp",
860      "jsview/js_container_modal_view.cpp",
861      "jsview/js_container_span.cpp",
862      "jsview/js_content_slot.cpp",
863      "jsview/js_counter.cpp",
864      "jsview/js_data_panel.cpp",
865      "jsview/js_datepicker.cpp",
866      "jsview/js_divider.cpp",
867      "jsview/js_ellipse.cpp",
868      "jsview/js_ellipse_shape.cpp",
869      "jsview/js_flex.cpp",
870      "jsview/js_flex_impl.cpp",
871      "jsview/js_foreach.cpp",
872      "jsview/js_form_link.cpp",
873      "jsview/js_gauge.cpp",
874      "jsview/js_gesture.cpp",
875      "jsview/js_grid.cpp",
876      "jsview/js_grid_col.cpp",
877      "jsview/js_grid_container.cpp",
878      "jsview/js_grid_item.cpp",
879      "jsview/js_grid_row.cpp",
880      "jsview/js_hyperlink.cpp",
881      "jsview/js_if_else.cpp",
882      "jsview/js_image.cpp",
883      "jsview/js_image_animator.cpp",
884      "jsview/js_image_span.cpp",
885      "jsview/js_indexer.cpp",
886      "jsview/js_indicator.cpp",
887      "jsview/js_interactable_view.cpp",
888      "jsview/js_keyboard_avoid.cpp",
889      "jsview/js_layout_manager.cpp",
890      "jsview/js_layoutable_view.cpp",
891      "jsview/js_lazy_foreach.cpp",
892      "jsview/js_lazy_grid.cpp",
893      "jsview/js_line.cpp",
894      "jsview/js_linear_gradient.cpp",
895      "jsview/js_linear_indicator.cpp",
896      "jsview/js_linear_indicator_controller.cpp",
897      "jsview/js_list.cpp",
898      "jsview/js_list_item.cpp",
899      "jsview/js_list_item_group.cpp",
900      "jsview/js_loading_progress.cpp",
901      "jsview/js_location_button.cpp",
902      "jsview/js_marquee.cpp",
903      "jsview/js_menu.cpp",
904      "jsview/js_menu_item.cpp",
905      "jsview/js_menu_item_group.cpp",
906      "jsview/js_mock.cpp",
907      "jsview/js_nav_path_stack.cpp",
908      "jsview/js_navdestination.cpp",
909      "jsview/js_navdestination_context.cpp",
910      "jsview/js_navdestination_scrollable_processor.cpp",
911      "jsview/js_navigation.cpp",
912      "jsview/js_navigation_stack.cpp",
913      "jsview/js_navigation_utils.cpp",
914      "jsview/js_navigator.cpp",
915      "jsview/js_navrouter.cpp",
916      "jsview/js_node_container.cpp",
917      "jsview/js_page_transition.cpp",
918      "jsview/js_paste_button.cpp",
919      "jsview/js_path.cpp",
920      "jsview/js_path_shape.cpp",
921      "jsview/js_polygon.cpp",
922      "jsview/js_polyline.cpp",
923      "jsview/js_popups.cpp",
924      "jsview/js_progress.cpp",
925      "jsview/js_radio.cpp",
926      "jsview/js_rating.cpp",
927      "jsview/js_rect.cpp",
928      "jsview/js_rect_shape.cpp",
929      "jsview/js_recycle_view.cpp",
930      "jsview/js_refresh.cpp",
931      "jsview/js_repeat.cpp",
932      "jsview/js_repeat_virtual_scroll.cpp",
933      "jsview/js_richeditor.cpp",
934      "jsview/js_row.cpp",
935      "jsview/js_save_button.cpp",
936      "jsview/js_scope_util.cpp",
937      "jsview/js_scroll.cpp",
938      "jsview/js_scrollable.cpp",
939      "jsview/js_scrollable_base.cpp",
940      "jsview/js_scroller.cpp",
941      "jsview/js_search.cpp",
942      "jsview/js_sec_button_base.cpp",
943      "jsview/js_shape.cpp",
944      "jsview/js_shape_abstract.cpp",
945      "jsview/js_side_bar.cpp",
946      "jsview/js_slider.cpp",
947      "jsview/js_sliding_panel.cpp",
948      "jsview/js_span.cpp",
949      "jsview/js_stack.cpp",
950      "jsview/js_swiper.cpp",
951      "jsview/js_symbol.cpp",
952      "jsview/js_symbol_span.cpp",
953      "jsview/js_tab_content.cpp",
954      "jsview/js_tabs.cpp",
955      "jsview/js_tabs_controller.cpp",
956      "jsview/js_tabs_feature.cpp",
957      "jsview/js_text.cpp",
958      "jsview/js_text_clock.cpp",
959      "jsview/js_text_editable_controller.cpp",
960      "jsview/js_textarea.cpp",
961      "jsview/js_textfield.cpp",
962      "jsview/js_textinput.cpp",
963      "jsview/js_textpicker.cpp",
964      "jsview/js_texttimer.cpp",
965      "jsview/js_toggle.cpp",
966      "jsview/js_utils.cpp",
967      "jsview/js_view.cpp",
968      "jsview/js_view_abstract.cpp",
969      "jsview/js_view_abstract_bridge.cpp",
970      "jsview/js_view_context.cpp",
971      "jsview/js_water_flow.cpp",
972      "jsview/js_water_flow_item.cpp",
973      "jsview/js_water_flow_sections.cpp",
974      "jsview/menu/js_context_menu.cpp",
975      "jsview/scroll_bar/js_scroll_bar.cpp",
976      "jsview/text_menu/js_text_menu.cpp",
977      "style_string/js_span_object.cpp",
978      "style_string/js_span_string.cpp",
979
980      # ark_theme
981      "ark_theme/theme_apply/js_with_theme.cpp",
982    ]
983
984    if (!ace_engine_feature_wearable) {
985      sources += [
986        "jsview/js_column_split.cpp",
987        "jsview/js_folder_stack.cpp",
988        "jsview/js_row_split.cpp",
989        "jsview/js_select.cpp",
990        "jsview/js_stepper.cpp",
991        "jsview/js_stepper_item.cpp",
992      ]
993    }
994
995    if (ace_engine_feature_enable_digital_crown) {
996      sources += [ "engine/functions/js_crown_function.cpp" ]
997    }
998
999    sources += [
1000      "$ace_root/frameworks/bridge/js_frontend/engine/common/js_engine.cpp",
1001    ]
1002
1003    external_deps = [ "graphic_2d:drawing_napi_impl" ]
1004    if (use_hilog) {
1005      external_deps += [ "hilog:libhilog" ]
1006    }
1007
1008    if (!defined(config.use_components_lib) || !config.use_components_lib) {
1009      sources += [
1010        "jsview/js_pattern_lock.cpp",
1011        "jsview/js_relative_container.cpp",
1012      ]
1013      if (qrcodegen_support) {
1014        sources += [ "jsview/js_qrcode.cpp" ]
1015      }
1016    }
1017
1018    if (defined(config.video_components_support) &&
1019        config.video_components_support) {
1020      sources += [
1021        "jsview/js_video.cpp",
1022        "jsview/js_video_controller.cpp",
1023      ]
1024      if (defined(config.video_support_jsstack) &&
1025          config.video_support_jsstack) {
1026        external_deps += [ "hiview:libxpower_event_js" ]
1027      }
1028    }
1029
1030    if (defined(config.window_scene_support) && config.window_scene_support) {
1031      sources += [
1032        "jsview/js_embedded_component.cpp",
1033        "jsview/js_security_ui_extension.cpp",
1034        "jsview/js_ui_extension.cpp",
1035        "jsview/window_scene/js_root_scene.cpp",
1036        "jsview/window_scene/js_screen.cpp",
1037        "jsview/window_scene/js_window_scene.cpp",
1038      ]
1039
1040      if (defined(config.dynamic_component_support) &&
1041          config.dynamic_component_support && !build_ohos_sdk) {
1042        external_deps += [ "ets_utils:worker" ]
1043
1044        sources += [
1045          "jsview/js_dynamic_component.cpp",
1046          "jsview/js_isolated_component.cpp",
1047        ]
1048      }
1049    }
1050    if (is_ohos_standard_system && !build_ohos_sdk) {
1051      sources += [ "jsview/js_form_button.cpp" ]
1052    }
1053    if (defined(config.enable_ability_component) &&
1054        config.enable_ability_component) {
1055      sources += [
1056        "jsview/js_ability_component.cpp",
1057        "jsview/js_ability_component_controller.cpp",
1058      ]
1059
1060      external_deps += [
1061        "input:libmmi-client",
1062        "window_manager:scene_session",
1063      ]
1064    }
1065
1066    if (defined(config.form_components_support) &&
1067        config.form_components_support) {
1068      sources += [ "jsview/js_form.cpp" ]
1069    }
1070
1071    if (defined(config.plugin_components_support) &&
1072        config.plugin_components_support) {
1073      sources += [ "jsview/js_plugin.cpp" ]
1074    }
1075
1076    if (defined(config.web_components_support) &&
1077        config.web_components_support) {
1078      sources += [
1079        "jsview/js_richtext.cpp",
1080        "jsview/js_web.cpp",
1081        "jsview/js_web_controller.cpp",
1082      ]
1083    }
1084
1085    if (defined(config.remote_window_support) && config.remote_window_support) {
1086      sources += [ "jsview/js_remote_window.cpp" ]
1087    }
1088
1089    if (!defined(vendor_configs.ace_engine_advanced)) {
1090      sources += [ "jsview/js_cached_image.cpp" ]
1091    }
1092
1093    if (defined(config.xcomponent_components_support) &&
1094        config.xcomponent_components_support) {
1095      sources += [
1096        "jsview/js_xcomponent.cpp",
1097        "jsview/js_xcomponent_controller.cpp",
1098      ]
1099    }
1100
1101    if (defined(config.effect_component_support) &&
1102        config.effect_component_support) {
1103      sources += [
1104        "jsview/js_effect_component.cpp",
1105        #"jsview/models/effect_component_model_impl.cpp",
1106      ]
1107    }
1108
1109    if (defined(config.model_component_support) &&
1110        config.model_component_support) {
1111      sources += [ "jsview/js_sceneview.cpp" ]
1112      external_deps += [ "graphic_3d:lib3dWidgetAdapter" ]
1113    }
1114
1115    if (defined(config.use_build_in_js_engine) &&
1116        config.use_build_in_js_engine) {
1117      deps += [ "$ace_root/frameworks/bridge:framework_bridge_ng_$platform" ]
1118      defines += [ "BUILT_IN_JS_ENGINE" ]
1119    } else {
1120      if (is_asan) {
1121        deps += [ "$ace_root/build:libace_compatible" ]
1122      } else {
1123        deps += [ "$ace_root/build:libace" ]
1124      }
1125      if (defined(config.build_container_scope_lib) &&
1126          config.build_container_scope_lib) {
1127        deps += [ "$ace_root/frameworks/core:ace_container_scope" ]
1128      }
1129    }
1130
1131    # add for cross_platfrom_build temporarily, shall be removed after external_deps is supported
1132    if (is_arkui_x) {
1133      sources -= [
1134        "interfaces/profiler/js_profiler.cpp",
1135        "jsview/js_location_button.cpp",
1136        "jsview/js_paste_button.cpp",
1137        "jsview/js_save_button.cpp",
1138        "jsview/js_sec_button_base.cpp",
1139        "jsview/menu/js_context_menu.cpp",
1140        "jsview/text_menu/js_text_menu.cpp",
1141      ]
1142      configs += [ "$ark_ets_path:ark_jsruntime_public_config" ]
1143      deps += [
1144        "$ace_graphic/rosen/modules/render_service_base:librender_service_base_static",
1145        "$ark_ets_path:libark_jsruntime_static",
1146        "//foundation/graphic/graphic_2d/interfaces/kits/napi/graphic/drawing:drawing_napi_impl",
1147      ]
1148      if (defined(config.pixel_map_support) && config.pixel_map_support) {
1149        configs += [ "//foundation/multimedia/image_framework/interfaces/innerkits:image_external_config" ]
1150      }
1151    } else {
1152      external_deps += [
1153        "ets_runtime:libark_jsruntime",
1154        "graphic_2d:librender_service_client",
1155        "napi:ace_napi",
1156      ]
1157    }
1158
1159    if (defined(config.enable_drag_framework) && config.enable_drag_framework &&
1160        defined(global_parts_info.distributeddatamgr_udmf)) {
1161      external_deps += [
1162        "udmf:udmf_client",
1163        "udmf:udmf_data_napi",
1164      ]
1165    }
1166
1167    if (!use_mingw_win && !use_mac && !use_linux) {
1168      external_deps += [
1169        "image_framework:image",
1170        "image_framework:image_native",
1171      ]
1172    }
1173  }
1174}
1175
1176# dynamic generate js_engine targets
1177foreach(item, ace_platforms) {
1178  platform = item.name
1179  engine_config = {
1180  }
1181  engine_config = item.config
1182  support_engines = []
1183  support_engines = engine_config.js_engines
1184  foreach(engine, support_engines) {
1185    declarative_js_engine(
1186        "declarative_js_engine_${engine.engine_name}_$platform") {
1187      platform = item.name
1188      engine_name = engine.engine_name
1189      engine_path = engine.engine_path
1190      defines = engine.engine_defines
1191
1192      config = {
1193      }
1194      if (defined(item.config)) {
1195        config = item.config
1196      }
1197      if (defined(config.defines)) {
1198        defines += config.defines
1199      }
1200    }
1201
1202    declarative_js_engine_ng(
1203        "declarative_js_engine_ng_${engine.engine_name}_$platform") {
1204      platform = item.name
1205      engine_name = engine.engine_name
1206      engine_path = engine.engine_path
1207      defines = engine.engine_defines
1208
1209      config = {
1210      }
1211      if (defined(item.config)) {
1212        config = item.config
1213      }
1214      if (defined(config.defines)) {
1215        defines += config.defines
1216      }
1217    }
1218  }
1219}
1220
1221ohos_abc("statemanagement") {
1222  sources = [ "engine/jsStateManagement.js" ]
1223  output_name = "statemanagement"
1224  install_images = [ "system" ]
1225  module_install_dir = "etc/abc/arkui"
1226  subsystem_name = ace_engine_subsystem
1227  part_name = ace_engine_part
1228}
1229
1230ohos_abc("mock") {
1231  sources = [ "engine/jsMock.js" ]
1232  output_name = "mock"
1233  install_images = [ "system" ]
1234  module_install_dir = "etc/abc/arkui"
1235  subsystem_name = ace_engine_subsystem
1236  part_name = ace_engine_part
1237}
1238
1239ohos_abc("x_node") {
1240  sources = [ "engine/jsXNode.js" ]
1241  output_name = "node"
1242  install_images = [ "system" ]
1243  module_install_dir = "etc/abc/arkui"
1244  subsystem_name = ace_engine_subsystem
1245  part_name = ace_engine_part
1246}
1247
1248ohos_abc("prefetcher") {
1249  sources = [ "engine/jsPrefetcher.js" ]
1250  output_name = "prefetcher"
1251  install_images = [ "system" ]
1252  module_install_dir = "etc/abc/arkui"
1253  subsystem_name = ace_engine_subsystem
1254  part_name = ace_engine_part
1255}
1256
1257action("gen_uicontext_ohos") {
1258  script = "$ace_root/build/tools/gen_uicontext_ohos.py"
1259  inputs = [
1260    "$ace_root/frameworks/bridge/declarative_frontend/engine/jsUIContext.js",
1261  ]
1262  outputs = [ "$base_output_path/jsUIContext_ohos.js" ]
1263  args = [
1264    rebase_path(inputs[0]),
1265    rebase_path(outputs[0]),
1266  ]
1267}
1268
1269ohos_abc("uicontext") {
1270  sources = [ "$base_output_path/jsUIContext_ohos.js" ]
1271  output_name = "uicontext"
1272  deps = [ ":gen_uicontext_ohos" ]
1273  install_images = [ "system" ]
1274  module_install_dir = "etc/abc/arkui"
1275  subsystem_name = ace_engine_subsystem
1276  part_name = ace_engine_part
1277}
1278
1279ohos_abc("ark_theme_control") {
1280  sources = [ "engine/arkThemeControl.js" ]
1281  output_name = "theme"
1282  install_images = [ "system" ]
1283  module_install_dir = "etc/abc/arkui"
1284  subsystem_name = ace_engine_subsystem
1285  part_name = ace_engine_part
1286}
1287
1288ohos_abc("ark_modifier") {
1289  sources = [ "engine/arkModifier.js" ]
1290  output_name = "modifier"
1291  install_images = [ "system" ]
1292  module_install_dir = "etc/abc/arkui"
1293  subsystem_name = ace_engine_subsystem
1294  part_name = ace_engine_part
1295}
1296
1297ohos_abc("shape") {
1298  sources = [ "engine/jsShape.js" ]
1299  output_name = "shape"
1300  install_images = [ "system" ]
1301  module_install_dir = "etc/abc/arkui"
1302  subsystem_name = ace_engine_subsystem
1303  part_name = ace_engine_part
1304}
1305