• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//foundation/arkui/ace_engine/ace_config.gni")
16import("../../build/uicast.gni")
17
18# build core sources
19template("ace_core_source_set") {
20  forward_variables_from(invoker, "*")
21
22  ohos_source_set(target_name) {
23    subsystem_name = ace_engine_subsystem
24    part_name = ace_engine_part
25    defines += invoker.defines
26    platform = invoker.platform
27
28    # add common source file needed by all product platform here
29    sources = [
30      # accessibility
31      "accessibility/accessibility_node.cpp",
32      "accessibility/accessibility_utils.cpp",
33
34      # animation
35      "animation/animatable_data.cpp",
36      "animation/animatable_properties.cpp",
37      "animation/animation_util.cpp",
38      "animation/animator.cpp",
39      "animation/animator_group.cpp",
40      "animation/anticipate_curve.cpp",
41      "animation/bilateral_spring_adapter.cpp",
42      "animation/bilateral_spring_node.cpp",
43      "animation/card_transition_controller.cpp",
44      "animation/cubic_curve.cpp",
45      "animation/curves.cpp",
46      "animation/friction_motion.cpp",
47      "animation/property_animation.cpp",
48      "animation/scheduler.cpp",
49      "animation/scroll_motion.cpp",
50      "animation/shared_transition_controller.cpp",
51      "animation/shared_transition_effect.cpp",
52      "animation/simple_spring_adapter.cpp",
53      "animation/simple_spring_chain.cpp",
54      "animation/simple_spring_node.cpp",
55      "animation/spring_animation.cpp",
56      "animation/spring_curve.cpp",
57      "animation/spring_model.cpp",
58      "animation/spring_motion.cpp",
59      "animation/svg_animate.cpp",
60
61      # common
62      "common/ace_application_info.cpp",
63      "common/ace_engine.cpp",
64      "common/ace_engine_ext.cpp",
65      "common/anr_thread.cpp",
66      "common/card_scope.cpp",
67      "common/clipboard/clipboard_proxy.cpp",
68      "common/container.cpp",
69      "common/container_scope.cpp",
70      "common/environment/environment_proxy.cpp",
71      "common/event_manager.cpp",
72      "common/focus_animation_manager.cpp",
73      "common/font_loader.cpp",
74      "common/font_manager.cpp",
75      "common/platform_bridge.cpp",
76      "common/sharedata/share_data.cpp",
77      "common/storage/storage_proxy.cpp",
78      "common/text_field_manager.cpp",
79      "common/thread_checker.cpp",
80      "common/vibrator/vibrator_proxy.cpp",
81      "common/watch_dog.cpp",
82      "common/window.cpp",
83
84      # declaration
85      "components/declaration/badge/badge_declaration.cpp",
86      "components/declaration/button/button_declaration.cpp",
87      "components/declaration/canvas/canvas_declaration.cpp",
88      "components/declaration/clock/clock_declaration.cpp",
89      "components/declaration/common/declaration.cpp",
90      "components/declaration/common/declaration_constants.cpp",
91      "components/declaration/common/declaration_creator_manager.cpp",
92      "components/declaration/common/event.cpp",
93      "components/declaration/div/div_declaration.cpp",
94      "components/declaration/image/image_animator_declaration.cpp",
95      "components/declaration/input/input_declaration.cpp",
96      "components/declaration/piece/piece_declaration.cpp",
97      "components/declaration/qrcode/qrcode_declaration.cpp",
98      "components/declaration/richtext/rich_text_declaration.cpp",
99      "components/declaration/search/search_declaration.cpp",
100      "components/declaration/side_bar/side_bar_declaration.cpp",
101      "components/declaration/span/span_declaration.cpp",
102      "components/declaration/svg/svg_animate_declaration.cpp",
103      "components/declaration/svg/svg_base_declaration.cpp",
104      "components/declaration/svg/svg_circle_declaration.cpp",
105      "components/declaration/svg/svg_declaration.cpp",
106      "components/declaration/svg/svg_ellipse_declaration.cpp",
107      "components/declaration/svg/svg_fe_colormatrix_declaration.cpp",
108      "components/declaration/svg/svg_fe_component_transfer_declaration.cpp",
109      "components/declaration/svg/svg_fe_composite_declaration.cpp",
110      "components/declaration/svg/svg_fe_declaration.cpp",
111      "components/declaration/svg/svg_fe_flood_declaration.cpp",
112      "components/declaration/svg/svg_fe_func_declaration.cpp",
113      "components/declaration/svg/svg_fe_gaussianblur_declaration.cpp",
114      "components/declaration/svg/svg_fe_merge_declaration.cpp",
115      "components/declaration/svg/svg_fe_merge_node_declaration.cpp",
116      "components/declaration/svg/svg_fe_offset_declaration.cpp",
117      "components/declaration/svg/svg_filter_declaration.cpp",
118      "components/declaration/svg/svg_gradient_declaration.cpp",
119      "components/declaration/svg/svg_line_declaration.cpp",
120      "components/declaration/svg/svg_mask_declaration.cpp",
121      "components/declaration/svg/svg_path_declaration.cpp",
122      "components/declaration/svg/svg_pattern_declaration.cpp",
123      "components/declaration/svg/svg_polygon_declaration.cpp",
124      "components/declaration/svg/svg_rect_declaration.cpp",
125      "components/declaration/svg/svg_stop_declaration.cpp",
126      "components/declaration/svg/svg_text_declaration.cpp",
127      "components/declaration/svg/svg_text_path_declaration.cpp",
128      "components/declaration/swiper/swiper_declaration.cpp",
129      "components/declaration/text/text_declaration.cpp",
130      "components/declaration/textarea/textarea_declaration.cpp",
131      "components/declaration/textfield/textfield_declaration.cpp",
132      "components/declaration/texttimer/texttimer_declaration.cpp",
133      "components/declaration/web/web_declaration.cpp",
134      "components/declaration/xcomponent/xcomponent_declaration.cpp",
135
136      # gestures
137      "gestures/click_recognizer.cpp",
138      "gestures/drag_recognizer.cpp",
139      "gestures/exclusive_recognizer.cpp",
140      "gestures/gesture_recognizer.cpp",
141      "gestures/gesture_referee.cpp",
142      "gestures/long_press_recognizer.cpp",
143      "gestures/multi_fingers_recognizer.cpp",
144      "gestures/pan_recognizer.cpp",
145      "gestures/parallel_recognizer.cpp",
146      "gestures/pinch_recognizer.cpp",
147      "gestures/press_recognizer.cpp",
148      "gestures/raw_recognizer.cpp",
149      "gestures/rotation_recognizer.cpp",
150      "gestures/sequenced_recognizer.cpp",
151      "gestures/single_child_gesture.cpp",
152      "gestures/slide_recognizer.cpp",
153      "gestures/swipe_recognizer.cpp",
154      "gestures/timeout_recognizer.cpp",
155      "gestures/velocity_tracker.cpp",
156
157      # declarative
158      "gestures/gesture_group.cpp",
159      "gestures/long_press_gesture.cpp",
160      "gestures/pan_gesture.cpp",
161      "gestures/pinch_gesture.cpp",
162      "gestures/rotation_gesture.cpp",
163      "gestures/slide_gesture.cpp",
164      "gestures/tap_gesture.cpp",
165      "gestures/timeout_gesture.cpp",
166
167      # event
168      "event/back_end_event_manager.cpp",
169      "event/event_convertor.cpp",
170      "event/key_event.cpp",
171      "event/key_event_recognizer.cpp",
172      "event/mouse_raw_recognizer.cpp",
173
174      # focus
175      "focus/focus_node.cpp",
176
177      # image
178      "image/animated_image_player.cpp",
179      "image/flutter_image_cache.cpp",
180      "image/image_cache.cpp",
181      "image/image_compressor.cpp",
182      "image/image_loader.cpp",
183      "image/image_object.cpp",
184      "image/image_object_animated.cpp",
185      "image/image_object_svg.cpp",
186      "image/image_provider.cpp",
187      "image/image_source_info.cpp",
188
189      # textfield
190      "common/ime/text_editing_value.cpp",
191      "common/ime/text_input_action.cpp",
192      "common/ime/text_input_configuration.cpp",
193      "common/ime/text_input_connection.cpp",
194      "common/ime/text_input_formatter.cpp",
195      "common/ime/text_input_proxy.cpp",
196      "common/ime/text_input_type.cpp",
197
198      # flutter impl
199      "common/flutter/flutter_asset_manager.cpp",
200      "common/flutter/flutter_task_executor.cpp",
201      "common/flutter/flutter_window.cpp",
202    ]
203
204    defines += uicast_configs.uicast_defines
205    sources += uicast_configs.uicast_core_sources
206
207    if (platform == "ohos") {
208      sources -= [ "common/anr_thread.cpp" ]
209    }
210
211    # add sources needed by phone and TV. wearable like watch do not need them
212    if (!is_wearable_product) {
213      sources += [
214        "event/multimodal/multimodal_manager.cpp",
215        "event/multimodal/multimodal_scene.cpp",
216      ]
217    }
218
219    # add sources needed by phone, tv and wearable. previews do not need them
220    if (defined(config.connect_server_support) &&
221        config.connect_server_support) {
222      sources += [ "common/connect_server_manager.cpp" ]
223    }
224
225    if (defined(config.hdc_register_support) && config.hdc_register_support) {
226      sources += [ "common/hdc_register.cpp" ]
227    }
228
229    configs = [ "$ace_root:ace_config" ]
230
231    deps = [
232      "$ace_flutter_engine_root:third_party_flutter_engine_$platform",
233      "$ace_flutter_engine_root/skia:ace_skia_$platform",
234      "pipeline:ace_core_pipeline_$platform",
235      "pipeline_ng:ace_core_pipeline_ng_$platform",
236    ]
237
238    deps += [
239      "$ace_root/frameworks/core/components/ability_component:ace_core_components_ability_$platform",
240      "$ace_root/frameworks/core/components/align:ace_core_components_align_$platform",
241      "$ace_root/frameworks/core/components/arc:ace_core_components_arc_$platform",
242      "$ace_root/frameworks/core/components/badge:ace_core_components_badge_$platform",
243      "$ace_root/frameworks/core/components/box:ace_core_components_box_$platform",
244      "$ace_root/frameworks/core/components/bubble:ace_core_components_bubble_$platform",
245      "$ace_root/frameworks/core/components/button:ace_core_components_button_$platform",
246      "$ace_root/frameworks/core/components/calendar:ace_core_components_calendar_$platform",
247      "$ace_root/frameworks/core/components/chart:ace_core_components_chart_$platform",
248      "$ace_root/frameworks/core/components/checkable:ace_core_components_checkable_$platform",
249      "$ace_root/frameworks/core/components/clip:ace_core_components_clip_$platform",
250      "$ace_root/frameworks/core/components/clock:ace_core_components_clock_$platform",
251      "$ace_root/frameworks/core/components/common:ace_core_components_common_$platform",
252      "$ace_root/frameworks/core/components/container_modal:ace_core_components_container_modal_$platform",
253      "$ace_root/frameworks/core/components/counter:ace_core_components_counter_$platform",
254      "$ace_root/frameworks/core/components/coverage:ace_core_components_coverage_$platform",
255      "$ace_root/frameworks/core/components/custom_dialog:ace_core_components_custom_dialog_$platform",
256      "$ace_root/frameworks/core/components/custom_paint:ace_core_components_custom_paint_$platform",
257      "$ace_root/frameworks/core/components/data_panel:ace_core_components_data_panel_$platform",
258      "$ace_root/frameworks/core/components/dialog:ace_core_components_dialog_$platform",
259      "$ace_root/frameworks/core/components/dialog_modal:ace_core_components_dialog_modal_$platform",
260      "$ace_root/frameworks/core/components/dialog_tween:ace_core_components_dialog_tween_$platform",
261      "$ace_root/frameworks/core/components/display:ace_core_components_display_$platform",
262      "$ace_root/frameworks/core/components/divider:ace_core_components_divider_$platform",
263      "$ace_root/frameworks/core/components/drag_bar:ace_core_components_drag_bar_$platform",
264      "$ace_root/frameworks/core/components/drop_filter:ace_core_components_drop_filter_$platform",
265      "$ace_root/frameworks/core/components/flex:ace_core_components_flex_$platform",
266      "$ace_root/frameworks/core/components/focus_animation:ace_core_components_focus_animation_$platform",
267      "$ace_root/frameworks/core/components/focus_collaboration:ace_core_components_focus_collaboration_$platform",
268      "$ace_root/frameworks/core/components/focusable:ace_core_components_focusable_$platform",
269      "$ace_root/frameworks/core/components/font:ace_core_components_font_$platform",
270      "$ace_root/frameworks/core/components/foreach:ace_core_components_foreach_$platform",
271      "$ace_root/frameworks/core/components/gesture_listener:ace_core_components_gesture_listener_$platform",
272      "$ace_root/frameworks/core/components/grid:ace_core_components_grid_$platform",
273      "$ace_root/frameworks/core/components/grid_layout:ace_core_components_grid_layout_$platform",
274      "$ace_root/frameworks/core/components/hyperlink:ace_core_components_hyperlink_$platform",
275      "$ace_root/frameworks/core/components/ifelse:ace_core_components_ifelse_$platform",
276      "$ace_root/frameworks/core/components/image:ace_core_components_image_$platform",
277      "$ace_root/frameworks/core/components/indexer:ace_core_components_indexer_$platform",
278      "$ace_root/frameworks/core/components/list:ace_core_components_list_$platform",
279      "$ace_root/frameworks/core/components/marquee:ace_core_components_marquee_$platform",
280      "$ace_root/frameworks/core/components/menu:ace_core_components_menu_$platform",
281      "$ace_root/frameworks/core/components/mouse_listener:ace_core_components_mouse_listener_$platform",
282      "$ace_root/frameworks/core/components/navigation_bar:ace_core_components_navigation_bar_$platform",
283      "$ace_root/frameworks/core/components/navigator:ace_core_components_navigator_$platform",
284      "$ace_root/frameworks/core/components/option:ace_core_components_option_$platform",
285      "$ace_root/frameworks/core/components/overlay:ace_core_components_overlay_$platform",
286      "$ace_root/frameworks/core/components/padding:ace_core_components_padding_$platform",
287      "$ace_root/frameworks/core/components/page:ace_core_components_page_$platform",
288      "$ace_root/frameworks/core/components/page_transition:ace_core_components_page_transition_$platform",
289      "$ace_root/frameworks/core/components/panel:ace_core_components_panel_$platform",
290      "$ace_root/frameworks/core/components/picker:ace_core_components_picker_$platform",
291      "$ace_root/frameworks/core/components/positioned:ace_core_components_positioned_$platform",
292      "$ace_root/frameworks/core/components/progress:ace_core_components_progress_$platform",
293      "$ace_root/frameworks/core/components/proxy:ace_core_components_proxy_$platform",
294      "$ace_root/frameworks/core/components/qrcode:ace_core_components_qrcode_$platform",
295      "$ace_root/frameworks/core/components/refresh:ace_core_components_refresh_$platform",
296      "$ace_root/frameworks/core/components/relative_container:ace_core_components_relative_container_$platform",
297      "$ace_root/frameworks/core/components/root:ace_core_components_root_$platform",
298      "$ace_root/frameworks/core/components/scoring:ace_core_components_scoring_$platform",
299      "$ace_root/frameworks/core/components/scroll:ace_core_components_scroll_$platform",
300      "$ace_root/frameworks/core/components/scroll_bar:ace_core_components_scroll_bar_$platform",
301      "$ace_root/frameworks/core/components/search:ace_core_components_search_$platform",
302      "$ace_root/frameworks/core/components/select_popup:ace_core_components_select_popup_$platform",
303      "$ace_root/frameworks/core/components/semi_modal:ace_core_components_semi_modal_$platform",
304      "$ace_root/frameworks/core/components/shadow:ace_core_components_shadow_$platform",
305      "$ace_root/frameworks/core/components/shape:ace_core_components_shape_$platform",
306      "$ace_root/frameworks/core/components/shared_transition:ace_core_components_shared_transition_$platform",
307      "$ace_root/frameworks/core/components/sheet:ace_core_components_sheet_$platform",
308      "$ace_root/frameworks/core/components/side_bar:ace_core_components_side_bar_$platform",
309      "$ace_root/frameworks/core/components/slider:ace_core_components_slider_$platform",
310      "$ace_root/frameworks/core/components/split_container:ace_core_components_split_container_$platform",
311      "$ace_root/frameworks/core/components/stack:ace_core_components_stack_$platform",
312      "$ace_root/frameworks/core/components/stage:ace_core_components_stage_$platform",
313      "$ace_root/frameworks/core/components/stepper:ace_core_components_stepper_$platform",
314      "$ace_root/frameworks/core/components/svg:ace_core_components_svg_$platform",
315      "$ace_root/frameworks/core/components/swiper:ace_core_components_swiper_$platform",
316      "$ace_root/frameworks/core/components/tab_bar:ace_core_components_tab_bar_$platform",
317      "$ace_root/frameworks/core/components/text:ace_core_components_text_$platform",
318      "$ace_root/frameworks/core/components/text_clock:ace_core_components_text_clock_$platform",
319      "$ace_root/frameworks/core/components/text_field:ace_core_components_text_field_$platform",
320      "$ace_root/frameworks/core/components/text_span:ace_core_components_text_span_$platform",
321      "$ace_root/frameworks/core/components/texttimer:ace_core_components_texttimer_$platform",
322      "$ace_root/frameworks/core/components/texttimer:ace_core_components_texttimer_$platform",
323      "$ace_root/frameworks/core/components/theme:ace_core_components_theme_$platform",
324      "$ace_root/frameworks/core/components/tip:ace_core_components_tip_$platform",
325      "$ace_root/frameworks/core/components/toast:ace_core_components_toast_$platform",
326      "$ace_root/frameworks/core/components/toggle:ace_core_components_toggle_$platform",
327      "$ace_root/frameworks/core/components/touch_listener:ace_core_components_touch_listener_$platform",
328      "$ace_root/frameworks/core/components/track:ace_core_components_track_$platform",
329      "$ace_root/frameworks/core/components/transform:ace_core_components_transform_$platform",
330      "$ace_root/frameworks/core/components/transition:ace_core_components_transition_$platform",
331      "$ace_root/frameworks/core/components/triangle:ace_core_components_triangle_$platform",
332      "$ace_root/frameworks/core/components/tween:ace_core_components_tween_$platform",
333      "$ace_root/frameworks/core/components/watch_slider:ace_core_components_watch_slider_$platform",
334      "$ace_root/frameworks/core/components/wrap:ace_core_components_wrap_$platform",
335    ]
336
337    deps += [
338      "$ace_root/frameworks/core/components_v2/common:ace_core_components_common_v2_$platform",
339      "$ace_root/frameworks/core/components_v2/foreach:ace_core_components_foreach_v2_$platform",
340      "$ace_root/frameworks/core/components_v2/grid:ace_core_components_grid_v2_$platform",
341      "$ace_root/frameworks/core/components_v2/grid_layout:ace_core_components_grid_layout_v2_$platform",
342      "$ace_root/frameworks/core/components_v2/indexer:ace_core_components_indexer_v2_$platform",
343      "$ace_root/frameworks/core/components_v2/inspector:ace_core_components_inspector_v2_$platform",
344      "$ace_root/frameworks/core/components_v2/list:ace_core_components_list_v2_$platform",
345      "$ace_root/frameworks/core/components_v2/pattern_lock:ace_core_components_pattern_lock_$platform",
346      "$ace_root/frameworks/core/components_v2/swiper:ace_core_components_swiper_v2_$platform",
347      "$ace_root/frameworks/core/components_v2/tabs:ace_core_components_tabs_v2_$platform",
348      "$ace_root/frameworks/core/components_v2/water_flow:ace_core_components_water_flow_v2_$platform",
349    ]
350
351    deps += [ "$ace_root/frameworks/core/components_part_upd/foreach:ace_core_components_foreach_part_upd_$platform" ]
352
353    deps += [
354      "$ace_root/frameworks/core/components_ng/base:ace_core_components_base_ng_$platform",
355      "$ace_root/frameworks/core/components_ng/event:ace_core_components_event_ng_$platform",
356      "$ace_root/frameworks/core/components_ng/gestures:ace_core_components_gestures_ng_$platform",
357      "$ace_root/frameworks/core/components_ng/image_provider:ace_core_components_image_provider_ng_$platform",
358      "$ace_root/frameworks/core/components_ng/layout:ace_core_components_layout_ng_$platform",
359      "$ace_root/frameworks/core/components_ng/manager:ace_core_components_manager_ng_$platform",
360      "$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_ng_$platform",
361      "$ace_root/frameworks/core/components_ng/property:ace_core_components_property_ng_$platform",
362      "$ace_root/frameworks/core/components_ng/render:ace_core_components_render_ng_$platform",
363      "$ace_root/frameworks/core/components_ng/svg:ace_core_components_svg_ng_$platform",
364      "$ace_root/frameworks/core/components_ng/syntax:ace_core_components_syntax_ng_$platform",
365    ]
366    if (defined(config.enable_ability_component) &&
367        config.enable_ability_component) {
368      deps += [ "$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_ability_component_ng_$platform" ]
369    }
370    if (defined(config.enable_image_compression) &&
371        config.enable_image_compression) {
372      deps += [ "//third_party/opencl-headers:libcl" ]
373      defines += [ "ENABLE_OPENCL" ]
374    }
375
376    if (current_os == "mingw" || current_os == "mac") {
377      sources -= [ "common/watch_dog.cpp" ]
378      sources += [ "common/watch_dog_mingw.cpp" ]
379    }
380
381    if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) {
382      sources += [
383        "animation/native_curve_helper.cpp",
384        "common/rosen/rosen_convert_helper.cpp",
385      ]
386      deps += [ "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client" ]
387    }
388
389    if (!use_mingw_win && !use_mac && !is_wearable_product &&
390        !is_standard_system && !use_linux) {
391      deps += [ "$ace_root/frameworks/core/components/rich_text:ace_core_components_rich_text_$platform" ]
392    }
393
394    if (defined(config.web_components_support) &&
395        config.web_components_support) {
396      deps += [
397        "$ace_root/frameworks/core/components/text_overlay:ace_core_components_text_overlay_for_web_$platform",
398        "$ace_root/frameworks/core/components/web:ace_core_components_web_$platform",
399        "$ace_root/frameworks/core/components_ng/pattern/web:ace_core_components_web_pattern_ng_$platform",
400      ]
401    } else {
402      deps += [ "$ace_root/frameworks/core/components/text_overlay:ace_core_components_text_overlay_$platform" ]
403    }
404
405    deps += [
406      "$ace_root/frameworks/core/components_ng/pattern/qrcode:ace_core_components_qrcode_pattern_ng_$platform",
407      "$ace_root/frameworks/core/components_ng/pattern/text_field:ace_core_components_text_field_pattern_ng_$platform",
408    ]
409
410    # xcomponent components supports phone, TV and wearable except PC Preview
411    if (defined(config.xcomponent_components_support) &&
412        config.xcomponent_components_support) {
413      deps += [ "$ace_root/frameworks/core/components/xcomponent:ace_core_components_xcomponent_$platform" ]
414    }
415
416    if (defined(config.enable_ability_component) &&
417        config.enable_ability_component) {
418      deps += [ "$ace_root/frameworks/core/components_v2/ability_component:ace_core_components_ability_v2_$platform" ]
419    }
420
421    if (defined(config.apng_image_support) && config.apng_image_support) {
422      defines += [ "APNG_IMAGE_SUPPORT" ]
423      deps += [ "$ace_root/frameworks/core/image/apng:ace_core_apng_$platform" ]
424    }
425
426    if (defined(config.form_components_support) &&
427        config.form_components_support) {
428      if (!use_mingw_win && !use_mac && !use_linux) {
429        sources += [ "common/form_manager.cpp" ]
430        deps += [
431          "$ace_root/frameworks/core/components/form:ace_core_components_form_$platform",
432          "$ace_root/frameworks/core/components_ng/pattern/form:ace_core_components_form_pattern_ng_$platform",
433        ]
434        external_deps = [ "form_fwk:form_manager" ]
435      }
436    }
437
438    if (defined(config.remote_window_support) && config.remote_window_support) {
439      if (!use_mingw_win && !use_mac && !use_linux) {
440        deps += [
441          "$ace_root/frameworks/core/components/remote_window:ace_core_components_remote_window_$platform",
442          "$ace_root/frameworks/core/components_ng/pattern/remote_window:ace_core_components_remote_window_pattern_ng_$platform",
443        ]
444      }
445    }
446
447    if (defined(config.build_container_scope_lib) &&
448        config.build_container_scope_lib) {
449      sources -= [ "common/container_scope.cpp" ]
450      if (defined(config.build_for_ios) && config.build_for_ios) {
451        deps += [ "$ace_napi:ace_container_scope_static" ]
452      } else {
453        deps += [ "$ace_napi:ace_container_scope" ]
454      }
455    }
456
457    if (defined(config.plugin_components_support) &&
458        config.plugin_components_support) {
459      deps += [
460        "$ace_root/frameworks/core/components/plugin:ace_core_components_plugin_$platform",
461        "$ace_root/frameworks/core/components_ng/pattern/plugin:ace_core_components_plugin_pattern_ng_$platform",
462      ]
463      sources += [ "common/plugin_manager.cpp" ]
464      deps += [ "//commonlibrary/c_utils/base:utils" ]
465    }
466
467    if (defined(config.preview_support) && config.preview_support) {
468      deps += [ "$ace_root/frameworks/core/components_ng/pattern/preview_mock:ace_core_components_preview_mock_pattern_ng_$platform" ]
469    }
470
471    include_dirs = [ "//foundation/window/window_manager/interfaces/innerkits" ]
472    include_dirs += uicast_configs.uicast_root_include
473
474    if (!is_wearable_product) {
475      deps += [
476        "$ace_root/frameworks/core/components/camera:ace_core_components_camera_$platform",
477        "$ace_root/frameworks/core/components/multimodal:ace_core_components_multimodal_$platform",
478        "$ace_root/frameworks/core/components/piece:ace_core_components_piece_$platform",
479        "$ace_root/frameworks/core/components/popup:ace_core_components_popup_$platform",
480        "$ace_root/frameworks/core/components/rating:ace_core_components_rating_$platform",
481        "$ace_root/frameworks/core/components/select:ace_core_components_select_$platform",
482        "$ace_root/frameworks/core/components/tool_bar:ace_core_components_tool_bar_$platform",
483        "$ace_root/frameworks/core/components/video:ace_core_components_video_$platform",
484      ]
485    }
486
487    deps += uicast_configs.uicast_root_deps
488
489    if ((current_os == "mingw" || current_os == "mac" ||
490         current_os == "linux") && defined(config.enable_rosen_backend) &&
491        config.enable_rosen_backend) {
492      sources -= [
493        "common/flutter/flutter_asset_manager.cpp",
494        "common/flutter/flutter_window.cpp",
495      ]
496      sources += [
497        # rs impl
498        "common/rosen/rosen_asset_manager.cpp",
499        "common/rosen/rosen_window.cpp",
500      ]
501      deps += [ "//third_party/libuv:uv" ]
502    }
503
504    cflags_cc = []
505    cflags_cc += invoker.cflags_cc
506  }
507}
508
509# build ng core sources
510template("ace_core_ng_source_set") {
511  forward_variables_from(invoker, "*")
512
513  ohos_source_set(target_name) {
514    subsystem_name = ace_engine_subsystem
515    part_name = ace_engine_part
516    defines += invoker.defines
517    platform = invoker.platform
518
519    # add common source file needed by all product platform here
520    sources = [
521      # accessibility
522      "accessibility/accessibility_node.cpp",
523      "accessibility/accessibility_utils.cpp",
524
525      # animation
526      "animation/animatable_data.cpp",
527      "animation/animatable_properties.cpp",
528      "animation/animation_util.cpp",
529      "animation/animator.cpp",
530      "animation/animator_group.cpp",
531      "animation/anticipate_curve.cpp",
532      "animation/bilateral_spring_adapter.cpp",
533      "animation/bilateral_spring_node.cpp",
534      "animation/card_transition_controller.cpp",
535      "animation/cubic_curve.cpp",
536      "animation/curves.cpp",
537      "animation/friction_motion.cpp",
538      "animation/property_animation.cpp",
539      "animation/scheduler.cpp",
540      "animation/scroll_motion.cpp",
541      "animation/simple_spring_adapter.cpp",
542      "animation/simple_spring_chain.cpp",
543      "animation/simple_spring_node.cpp",
544      "animation/spring_animation.cpp",
545      "animation/spring_curve.cpp",
546      "animation/spring_model.cpp",
547      "animation/spring_motion.cpp",
548      "animation/svg_animate.cpp",
549
550      # common
551      "common/ace_application_info.cpp",
552      "common/ace_engine.cpp",
553      "common/anr_thread.cpp",
554      "common/card_scope.cpp",
555      "common/clipboard/clipboard_proxy.cpp",
556      "common/container.cpp",
557      "common/container_scope.cpp",
558      "common/environment/environment_proxy.cpp",
559      "common/event_manager.cpp",
560      "common/focus_animation_manager.cpp",
561      "common/font_loader.cpp",
562      "common/font_manager.cpp",
563      "common/platform_bridge.cpp",
564      "common/sharedata/share_data.cpp",
565      "common/storage/storage_proxy.cpp",
566      "common/text_field_manager.cpp",
567      "common/thread_checker.cpp",
568      "common/vibrator/vibrator_proxy.cpp",
569      "common/watch_dog.cpp",
570      "common/window.cpp",
571
572      # event
573      "event/back_end_event_manager.cpp",
574      "event/event_convertor.cpp",
575      "event/key_event.cpp",
576      "event/key_event_recognizer.cpp",
577      "event/mouse_raw_recognizer.cpp",
578
579      # gestures
580      "gestures/click_recognizer.cpp",
581      "gestures/drag_recognizer.cpp",
582      "gestures/exclusive_recognizer.cpp",
583      "gestures/gesture_recognizer.cpp",
584      "gestures/gesture_referee.cpp",
585      "gestures/long_press_recognizer.cpp",
586      "gestures/multi_fingers_recognizer.cpp",
587      "gestures/pan_recognizer.cpp",
588      "gestures/parallel_recognizer.cpp",
589      "gestures/pinch_recognizer.cpp",
590      "gestures/press_recognizer.cpp",
591      "gestures/raw_recognizer.cpp",
592      "gestures/rotation_recognizer.cpp",
593      "gestures/sequenced_recognizer.cpp",
594      "gestures/single_child_gesture.cpp",
595      "gestures/slide_recognizer.cpp",
596      "gestures/swipe_recognizer.cpp",
597      "gestures/timeout_recognizer.cpp",
598      "gestures/velocity_tracker.cpp",
599
600      # declarative gestures
601      "gestures/gesture_group.cpp",
602      "gestures/long_press_gesture.cpp",
603      "gestures/pan_gesture.cpp",
604      "gestures/pinch_gesture.cpp",
605      "gestures/rotation_gesture.cpp",
606      "gestures/slide_gesture.cpp",
607      "gestures/tap_gesture.cpp",
608      "gestures/timeout_gesture.cpp",
609
610      # pipeline
611      "pipeline/base/constants.cpp",
612      "pipeline/base/element_register.cpp",
613      "pipeline/base/related_node.cpp",
614      "pipeline/pipeline_base.cpp",
615
616      # image
617      "image/animated_image_player.cpp",
618      "image/image_cache.cpp",
619      "image/image_compressor.cpp",
620      "image/image_loader.cpp",
621      "image/image_object.cpp",
622      "image/image_object_animated.cpp",
623      "image/image_object_svg.cpp",
624      "image/image_provider.cpp",
625      "image/image_source_info.cpp",
626
627      # textfield
628      "common/ime/text_editing_value.cpp",
629      "common/ime/text_input_action.cpp",
630      "common/ime/text_input_configuration.cpp",
631      "common/ime/text_input_connection.cpp",
632      "common/ime/text_input_formatter.cpp",
633      "common/ime/text_input_proxy.cpp",
634      "common/ime/text_input_type.cpp",
635
636      # properties
637      "components/common/properties/alignment.cpp",
638      "components/common/properties/animatable_path.cpp",
639      "components/common/properties/border.cpp",
640      "components/common/properties/border_edge.cpp",
641      "components/common/properties/border_image.cpp",
642      "components/common/properties/border_image_edge.cpp",
643      "components/common/properties/clip_path.cpp",
644      "components/common/properties/color.cpp",
645      "components/common/properties/color_factory.cpp",
646      "components/common/properties/decoration.cpp",
647      "components/common/properties/edge.cpp",
648      "components/common/properties/motion_path_evaluator.cpp",
649      "components/common/properties/page_transition_option.cpp",
650      "components/common/properties/scroll_bar.cpp",
651      "components/common/properties/shadow.cpp",
652      "components/common/properties/shadow_config.cpp",
653      "components/common/properties/text_style.cpp",
654      "components/common/properties/text_style_parser.cpp",
655
656      # layout
657      "components/common/layout/grid_column_info.cpp",
658      "components/common/layout/grid_container_info.cpp",
659      "components/common/layout/grid_system_manager.cpp",
660
661      # v1 deps
662      "$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp",
663      "$root_out_dir/arkui/framework/core/components/theme/theme_constants_tv.cpp",
664      "components/custom_paint/render_offscreen_canvas_creator.cpp",
665      "components/font/constants_converter.cpp",
666      "components/font/font_loader_creator.cpp",
667      "components/font/font_manager_creator.cpp",
668      "components/panel/sliding_events.cpp",
669      "components/picker/picker_data.cpp",
670      "components/scroll/scrollable.cpp",
671      "components/theme/app_theme.cpp",
672      "components/theme/icon_theme.cpp",
673      "components/theme/theme_attributes.cpp",
674      "components/theme/theme_constants.cpp",
675      "components/theme/theme_manager_impl.cpp",
676      "components/theme/theme_utils.cpp",
677
678      # v2 inspector
679      "components_v2/grid_layout/grid_container_utils.cpp",
680      "components_v2/inspector/inspector_constants.cpp",
681      "components_v2/inspector/utils.cpp",
682
683      # flutter impl
684      "common/flutter/flutter_asset_manager.cpp",
685      "common/flutter/flutter_task_executor.cpp",
686    ]
687
688    if (platform == "ohos") {
689      sources -= [ "common/anr_thread.cpp" ]
690    }
691
692    configs = [ "$ace_root:ace_config" ]
693
694    deps = [
695      "$ace_root/frameworks/core/components/theme:build_theme_code",
696      "pipeline_ng:ace_core_pipeline_ng_$platform",
697    ]
698
699    if (enable_ng_build) {
700      deps += [
701        "$ace_flutter_engine_root_new:third_party_flutter_engine_dev_$platform",
702        "$ace_flutter_engine_root_new/third_party/skia:ace_skia_dev_$platform",
703      ]
704    }
705
706    deps += [
707      "$ace_root/frameworks/core/components_ng/base:ace_core_components_base_ng_$platform",
708      "$ace_root/frameworks/core/components_ng/event:ace_core_components_event_ng_$platform",
709      "$ace_root/frameworks/core/components_ng/gestures:ace_core_components_gestures_ng_$platform",
710      "$ace_root/frameworks/core/components_ng/image_provider:ace_core_components_image_provider_ng_$platform",
711      "$ace_root/frameworks/core/components_ng/layout:ace_core_components_layout_ng_$platform",
712      "$ace_root/frameworks/core/components_ng/manager:ace_core_components_manager_ng_$platform",
713      "$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_ng_$platform",
714      "$ace_root/frameworks/core/components_ng/pattern/qrcode:ace_core_components_qrcode_pattern_ng_$platform",
715      "$ace_root/frameworks/core/components_ng/pattern/text_field:ace_core_components_text_field_pattern_ng_$platform",
716      "$ace_root/frameworks/core/components_ng/property:ace_core_components_property_ng_$platform",
717      "$ace_root/frameworks/core/components_ng/render:ace_core_components_render_ng_$platform",
718      "$ace_root/frameworks/core/components_ng/syntax:ace_core_components_syntax_ng_$platform",
719    ]
720
721    if (defined(config.enable_ability_component) &&
722        config.enable_ability_component) {
723      deps += [ "$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_ability_component_ng_$platform" ]
724    }
725    if (defined(config.web_components_support) &&
726        config.web_components_support) {
727      deps += [ "$ace_root/frameworks/core/components_ng/pattern/web:ace_core_components_web_pattern_ng_$platform" ]
728    }
729    if (defined(config.form_components_support) &&
730        config.form_components_support) {
731      if (!use_mingw_win && !use_mac && !use_linux) {
732        deps += [ "$ace_root/frameworks/core/components_ng/pattern/form:ace_core_components_form_pattern_ng_$platform" ]
733      }
734    }
735    if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) {
736      sources += [
737        "animation/native_curve_helper.cpp",
738        "common/rosen/rosen_convert_helper.cpp",
739      ]
740      deps += [ "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client" ]
741    }
742    cflags_cc = []
743    cflags_cc += invoker.cflags_cc
744  }
745}
746
747foreach(item, ace_platforms) {
748  ace_core_source_set("ace_core_" + item.name) {
749    platform = item.name
750
751    if (defined(item.config)) {
752      config = item.config
753    } else {
754      config = {
755      }
756    }
757
758    if (defined(config.defines)) {
759      defines = config.defines
760    } else {
761      defines = []
762    }
763
764    if (defined(config.cflags_cc)) {
765      cflags_cc = config.cflags_cc
766    } else {
767      cflags_cc = []
768    }
769  }
770
771  ace_core_ng_source_set("ace_core_ng_" + item.name) {
772    platform = item.name
773
774    if (defined(item.config)) {
775      config = item.config
776    } else {
777      config = {
778      }
779    }
780
781    if (defined(config.defines)) {
782      defines = config.defines
783    } else {
784      defines = []
785    }
786
787    if (defined(config.cflags_cc)) {
788      cflags_cc = config.cflags_cc
789    } else {
790      cflags_cc = []
791    }
792  }
793}
794