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") 16 17# build core sources 18template("ace_core_source_set") { 19 forward_variables_from(invoker, "*") 20 21 ohos_source_set(target_name) { 22 if (current_os == "ohos") { 23 sanitize = { 24 integer_overflow = true 25 boundary_sanitize = true 26 debug = ace_sanitize_debug 27 } 28 } 29 subsystem_name = ace_engine_subsystem 30 part_name = ace_engine_part 31 defines += invoker.defines 32 platform = invoker.platform 33 include_dirs = [] 34 35 # add common source file needed by all product platform here 36 sources = [ 37 # accessibility 38 "accessibility/accessibility_node.cpp", 39 "accessibility/accessibility_utils.cpp", 40 41 # animation 42 "animation/animatable_data.cpp", 43 "animation/animatable_properties.cpp", 44 "animation/animation_util.cpp", 45 "animation/animator.cpp", 46 "animation/animator_group.cpp", 47 "animation/anticipate_curve.cpp", 48 "animation/bilateral_spring_adapter.cpp", 49 "animation/bilateral_spring_node.cpp", 50 "animation/card_transition_controller.cpp", 51 "animation/chain_animation.cpp", 52 "animation/cubic_curve.cpp", 53 "animation/curves.cpp", 54 "animation/friction_motion.cpp", 55 "animation/property_animation.cpp", 56 "animation/scheduler.cpp", 57 "animation/scroll_motion.cpp", 58 "animation/shared_transition_controller.cpp", 59 "animation/shared_transition_effect.cpp", 60 "animation/simple_spring_adapter.cpp", 61 "animation/simple_spring_chain.cpp", 62 "animation/simple_spring_node.cpp", 63 "animation/spring_animation.cpp", 64 "animation/spring_curve.cpp", 65 "animation/spring_model.cpp", 66 "animation/spring_motion.cpp", 67 "animation/svg_animate.cpp", 68 69 # common 70 "common/ace_application_info.cpp", 71 "common/ace_engine.cpp", 72 "common/ace_engine_ext.cpp", 73 "common/anr_thread.cpp", 74 "common/card_scope.cpp", 75 "common/clipboard/clipboard_proxy.cpp", 76 "common/container.cpp", 77 "common/container_scope.cpp", 78 "common/environment/environment_proxy.cpp", 79 "common/event_manager.cpp", 80 "common/focus_animation_manager.cpp", 81 "common/font_loader.cpp", 82 "common/font_manager.cpp", 83 "common/frontend.cpp", 84 "common/platform_bridge.cpp", 85 "common/sharedata/share_data.cpp", 86 "common/storage/storage_proxy.cpp", 87 "common/text_field_manager.cpp", 88 "common/thread_checker.cpp", 89 "common/vibrator/vibrator_proxy.cpp", 90 "common/watch_dog.cpp", 91 "common/window.cpp", 92 93 # declaration 94 "components/declaration/badge/badge_declaration.cpp", 95 "components/declaration/button/button_declaration.cpp", 96 "components/declaration/canvas/canvas_declaration.cpp", 97 "components/declaration/clock/clock_declaration.cpp", 98 "components/declaration/common/declaration.cpp", 99 "components/declaration/common/declaration_constants.cpp", 100 "components/declaration/common/declaration_creator_manager.cpp", 101 "components/declaration/common/event.cpp", 102 "components/declaration/div/div_declaration.cpp", 103 "components/declaration/image/image_animator_declaration.cpp", 104 "components/declaration/input/input_declaration.cpp", 105 "components/declaration/piece/piece_declaration.cpp", 106 "components/declaration/qrcode/qrcode_declaration.cpp", 107 "components/declaration/richtext/rich_text_declaration.cpp", 108 "components/declaration/search/search_declaration.cpp", 109 "components/declaration/side_bar/side_bar_declaration.cpp", 110 "components/declaration/span/span_declaration.cpp", 111 "components/declaration/svg/svg_animate_declaration.cpp", 112 "components/declaration/svg/svg_base_declaration.cpp", 113 "components/declaration/svg/svg_circle_declaration.cpp", 114 "components/declaration/svg/svg_declaration.cpp", 115 "components/declaration/svg/svg_ellipse_declaration.cpp", 116 "components/declaration/svg/svg_fe_colormatrix_declaration.cpp", 117 "components/declaration/svg/svg_fe_component_transfer_declaration.cpp", 118 "components/declaration/svg/svg_fe_composite_declaration.cpp", 119 "components/declaration/svg/svg_fe_declaration.cpp", 120 "components/declaration/svg/svg_fe_flood_declaration.cpp", 121 "components/declaration/svg/svg_fe_func_declaration.cpp", 122 "components/declaration/svg/svg_fe_gaussianblur_declaration.cpp", 123 "components/declaration/svg/svg_fe_merge_declaration.cpp", 124 "components/declaration/svg/svg_fe_merge_node_declaration.cpp", 125 "components/declaration/svg/svg_fe_offset_declaration.cpp", 126 "components/declaration/svg/svg_filter_declaration.cpp", 127 "components/declaration/svg/svg_gradient_declaration.cpp", 128 "components/declaration/svg/svg_line_declaration.cpp", 129 "components/declaration/svg/svg_mask_declaration.cpp", 130 "components/declaration/svg/svg_path_declaration.cpp", 131 "components/declaration/svg/svg_pattern_declaration.cpp", 132 "components/declaration/svg/svg_polygon_declaration.cpp", 133 "components/declaration/svg/svg_rect_declaration.cpp", 134 "components/declaration/svg/svg_stop_declaration.cpp", 135 "components/declaration/svg/svg_text_declaration.cpp", 136 "components/declaration/svg/svg_text_path_declaration.cpp", 137 "components/declaration/swiper/swiper_declaration.cpp", 138 "components/declaration/text/text_declaration.cpp", 139 "components/declaration/textarea/textarea_declaration.cpp", 140 "components/declaration/textfield/textfield_declaration.cpp", 141 "components/declaration/texttimer/texttimer_declaration.cpp", 142 "components/declaration/web/web_declaration.cpp", 143 "components/declaration/xcomponent/xcomponent_declaration.cpp", 144 145 # gestures 146 "gestures/click_recognizer.cpp", 147 "gestures/drag_recognizer.cpp", 148 "gestures/exclusive_recognizer.cpp", 149 "gestures/gesture_recognizer.cpp", 150 "gestures/gesture_referee.cpp", 151 "gestures/long_press_recognizer.cpp", 152 "gestures/multi_fingers_recognizer.cpp", 153 "gestures/pan_recognizer.cpp", 154 "gestures/parallel_recognizer.cpp", 155 "gestures/pinch_recognizer.cpp", 156 "gestures/press_recognizer.cpp", 157 "gestures/raw_recognizer.cpp", 158 "gestures/rotation_recognizer.cpp", 159 "gestures/sequenced_recognizer.cpp", 160 "gestures/single_child_gesture.cpp", 161 "gestures/slide_recognizer.cpp", 162 "gestures/swipe_recognizer.cpp", 163 "gestures/timeout_recognizer.cpp", 164 "gestures/velocity_tracker.cpp", 165 166 # declarative 167 "gestures/gesture_group.cpp", 168 "gestures/long_press_gesture.cpp", 169 "gestures/pan_gesture.cpp", 170 "gestures/pinch_gesture.cpp", 171 "gestures/rotation_gesture.cpp", 172 "gestures/slide_gesture.cpp", 173 "gestures/tap_gesture.cpp", 174 "gestures/timeout_gesture.cpp", 175 176 # event 177 "event/back_end_event_manager.cpp", 178 "event/event_convertor.cpp", 179 "event/key_event.cpp", 180 "event/key_event_recognizer.cpp", 181 "event/mouse_raw_recognizer.cpp", 182 183 # focus 184 "focus/focus_node.cpp", 185 186 # image 187 "image/animated_image_player.cpp", 188 "image/flutter_image_cache.cpp", 189 "image/image_cache.cpp", 190 "image/image_compressor.cpp", 191 "image/image_loader.cpp", 192 "image/image_object.cpp", 193 "image/image_object_animated.cpp", 194 "image/image_object_svg.cpp", 195 "image/image_provider.cpp", 196 "image/image_source_info.cpp", 197 198 # textfield 199 "common/ime/text_editing_value.cpp", 200 "common/ime/text_input_action.cpp", 201 "common/ime/text_input_configuration.cpp", 202 "common/ime/text_input_connection.cpp", 203 "common/ime/text_input_formatter.cpp", 204 "common/ime/text_input_proxy.cpp", 205 "common/ime/text_input_type.cpp", 206 207 # flutter impl 208 "common/flutter/flutter_asset_manager.cpp", 209 "common/flutter/flutter_task_executor.cpp", 210 "common/flutter/flutter_thread_model.cpp", 211 ] 212 213 if (!(defined(config.enable_rosen_backend) && config.enable_rosen_backend)) { 214 sources += [ "common/flutter/flutter_window.cpp" ] 215 } 216 217 if (platform == "ohos") { 218 sources -= [ "common/anr_thread.cpp" ] 219 } 220 221 # add sources needed by phone and TV. wearable like watch do not need them 222 if (!is_wearable_product) { 223 sources += [ 224 "event/multimodal/multimodal_manager.cpp", 225 "event/multimodal/multimodal_scene.cpp", 226 ] 227 } 228 229 # add sources needed by phone, tv and wearable. previews do not need them 230 if (defined(config.connect_server_support) && 231 config.connect_server_support) { 232 if (use_ios) { 233 include_dirs += [ "$ark_toolchain_path" ] 234 } 235 sources += [ "common/connect_server_manager.cpp" ] 236 } 237 238 if (defined(config.hdc_register_support) && config.hdc_register_support) { 239 sources += [ "common/hdc_register.cpp" ] 240 } 241 242 configs = [ "$ace_root:ace_config" ] 243 244 deps = [ 245 "pipeline:ace_core_pipeline_$platform", 246 "pipeline_ng:ace_core_pipeline_ng_$platform", 247 ] 248 249 external_deps = [] 250 251 if (ace_use_new_skia) { 252 if (is_ohos) { 253 sources += [ 254 "$flutter_root/engine/flutter/shell/platform/ohos/platform_task_runner.cc", 255 "$flutter_root/engine/flutter/shell/platform/ohos/platform_task_runner_adapter.cc", 256 ] 257 } else { 258 sources += [ 259 "$flutter_root/engine/flutter/common/task_runners.cc", 260 "$flutter_root/engine/flutter/shell/common/thread_host.cc", 261 ] 262 } 263 configs += [ "$ace_flutter_engine_root:flutter_config" ] 264 deps += [ "$skia_root_new:skia_$platform" ] 265 } else { 266 deps += [ 267 "$ace_flutter_engine_root:third_party_flutter_engine_$platform", 268 "$ace_flutter_engine_root/skia:ace_skia_$platform", 269 ] 270 } 271 272 deps += [ 273 "$ace_root/frameworks/core/components/ability_component:ace_core_components_ability_$platform", 274 "$ace_root/frameworks/core/components/align:ace_core_components_align_$platform", 275 "$ace_root/frameworks/core/components/arc:ace_core_components_arc_$platform", 276 "$ace_root/frameworks/core/components/badge:ace_core_components_badge_$platform", 277 "$ace_root/frameworks/core/components/box:ace_core_components_box_$platform", 278 "$ace_root/frameworks/core/components/bubble:ace_core_components_bubble_$platform", 279 "$ace_root/frameworks/core/components/button:ace_core_components_button_$platform", 280 "$ace_root/frameworks/core/components/calendar:ace_core_components_calendar_$platform", 281 "$ace_root/frameworks/core/components/chart:ace_core_components_chart_$platform", 282 "$ace_root/frameworks/core/components/checkable:ace_core_components_checkable_$platform", 283 "$ace_root/frameworks/core/components/clip:ace_core_components_clip_$platform", 284 "$ace_root/frameworks/core/components/clock:ace_core_components_clock_$platform", 285 "$ace_root/frameworks/core/components/common:ace_core_components_common_$platform", 286 "$ace_root/frameworks/core/components/container_modal:ace_core_components_container_modal_$platform", 287 "$ace_root/frameworks/core/components/counter:ace_core_components_counter_$platform", 288 "$ace_root/frameworks/core/components/coverage:ace_core_components_coverage_$platform", 289 "$ace_root/frameworks/core/components/custom_dialog:ace_core_components_custom_dialog_$platform", 290 "$ace_root/frameworks/core/components/custom_paint:ace_core_components_custom_paint_$platform", 291 "$ace_root/frameworks/core/components/data_panel:ace_core_components_data_panel_$platform", 292 "$ace_root/frameworks/core/components/dialog:ace_core_components_dialog_$platform", 293 "$ace_root/frameworks/core/components/dialog_modal:ace_core_components_dialog_modal_$platform", 294 "$ace_root/frameworks/core/components/dialog_tween:ace_core_components_dialog_tween_$platform", 295 "$ace_root/frameworks/core/components/display:ace_core_components_display_$platform", 296 "$ace_root/frameworks/core/components/divider:ace_core_components_divider_$platform", 297 "$ace_root/frameworks/core/components/drag_bar:ace_core_components_drag_bar_$platform", 298 "$ace_root/frameworks/core/components/drop_filter:ace_core_components_drop_filter_$platform", 299 "$ace_root/frameworks/core/components/flex:ace_core_components_flex_$platform", 300 "$ace_root/frameworks/core/components/focus_animation:ace_core_components_focus_animation_$platform", 301 "$ace_root/frameworks/core/components/focus_collaboration:ace_core_components_focus_collaboration_$platform", 302 "$ace_root/frameworks/core/components/focusable:ace_core_components_focusable_$platform", 303 "$ace_root/frameworks/core/components/font:ace_core_components_font_$platform", 304 "$ace_root/frameworks/core/components/foreach:ace_core_components_foreach_$platform", 305 "$ace_root/frameworks/core/components/gesture_listener:ace_core_components_gesture_listener_$platform", 306 "$ace_root/frameworks/core/components/grid:ace_core_components_grid_$platform", 307 "$ace_root/frameworks/core/components/grid_layout:ace_core_components_grid_layout_$platform", 308 "$ace_root/frameworks/core/components/hyperlink:ace_core_components_hyperlink_$platform", 309 "$ace_root/frameworks/core/components/ifelse:ace_core_components_ifelse_$platform", 310 "$ace_root/frameworks/core/components/image:ace_core_components_image_$platform", 311 "$ace_root/frameworks/core/components/indexer:ace_core_components_indexer_$platform", 312 "$ace_root/frameworks/core/components/list:ace_core_components_list_$platform", 313 "$ace_root/frameworks/core/components/marquee:ace_core_components_marquee_$platform", 314 "$ace_root/frameworks/core/components/menu:ace_core_components_menu_$platform", 315 "$ace_root/frameworks/core/components/mouse_listener:ace_core_components_mouse_listener_$platform", 316 "$ace_root/frameworks/core/components/navigation_bar:ace_core_components_navigation_bar_$platform", 317 "$ace_root/frameworks/core/components/navigator:ace_core_components_navigator_$platform", 318 "$ace_root/frameworks/core/components/option:ace_core_components_option_$platform", 319 "$ace_root/frameworks/core/components/overlay:ace_core_components_overlay_$platform", 320 "$ace_root/frameworks/core/components/padding:ace_core_components_padding_$platform", 321 "$ace_root/frameworks/core/components/page:ace_core_components_page_$platform", 322 "$ace_root/frameworks/core/components/page_transition:ace_core_components_page_transition_$platform", 323 "$ace_root/frameworks/core/components/panel:ace_core_components_panel_$platform", 324 "$ace_root/frameworks/core/components/picker:ace_core_components_picker_$platform", 325 "$ace_root/frameworks/core/components/positioned:ace_core_components_positioned_$platform", 326 "$ace_root/frameworks/core/components/progress:ace_core_components_progress_$platform", 327 "$ace_root/frameworks/core/components/proxy:ace_core_components_proxy_$platform", 328 "$ace_root/frameworks/core/components/qrcode:ace_core_components_qrcode_$platform", 329 "$ace_root/frameworks/core/components/refresh:ace_core_components_refresh_$platform", 330 "$ace_root/frameworks/core/components/relative_container:ace_core_components_relative_container_$platform", 331 "$ace_root/frameworks/core/components/root:ace_core_components_root_$platform", 332 "$ace_root/frameworks/core/components/scoring:ace_core_components_scoring_$platform", 333 "$ace_root/frameworks/core/components/scroll:ace_core_components_scroll_$platform", 334 "$ace_root/frameworks/core/components/scroll_bar:ace_core_components_scroll_bar_$platform", 335 "$ace_root/frameworks/core/components/search:ace_core_components_search_$platform", 336 "$ace_root/frameworks/core/components/select_popup:ace_core_components_select_popup_$platform", 337 "$ace_root/frameworks/core/components/semi_modal:ace_core_components_semi_modal_$platform", 338 "$ace_root/frameworks/core/components/shadow:ace_core_components_shadow_$platform", 339 "$ace_root/frameworks/core/components/shape:ace_core_components_shape_$platform", 340 "$ace_root/frameworks/core/components/shared_transition:ace_core_components_shared_transition_$platform", 341 "$ace_root/frameworks/core/components/sheet:ace_core_components_sheet_$platform", 342 "$ace_root/frameworks/core/components/side_bar:ace_core_components_side_bar_$platform", 343 "$ace_root/frameworks/core/components/slider:ace_core_components_slider_$platform", 344 "$ace_root/frameworks/core/components/split_container:ace_core_components_split_container_$platform", 345 "$ace_root/frameworks/core/components/stack:ace_core_components_stack_$platform", 346 "$ace_root/frameworks/core/components/stage:ace_core_components_stage_$platform", 347 "$ace_root/frameworks/core/components/stepper:ace_core_components_stepper_$platform", 348 "$ace_root/frameworks/core/components/svg:ace_core_components_svg_$platform", 349 "$ace_root/frameworks/core/components/swiper:ace_core_components_swiper_$platform", 350 "$ace_root/frameworks/core/components/tab_bar:ace_core_components_tab_bar_$platform", 351 "$ace_root/frameworks/core/components/text:ace_core_components_text_$platform", 352 "$ace_root/frameworks/core/components/text_clock:ace_core_components_text_clock_$platform", 353 "$ace_root/frameworks/core/components/text_field:ace_core_components_text_field_$platform", 354 "$ace_root/frameworks/core/components/text_span:ace_core_components_text_span_$platform", 355 "$ace_root/frameworks/core/components/texttimer:ace_core_components_texttimer_$platform", 356 "$ace_root/frameworks/core/components/texttimer:ace_core_components_texttimer_$platform", 357 "$ace_root/frameworks/core/components/theme:ace_core_components_theme_$platform", 358 "$ace_root/frameworks/core/components/tip:ace_core_components_tip_$platform", 359 "$ace_root/frameworks/core/components/toast:ace_core_components_toast_$platform", 360 "$ace_root/frameworks/core/components/toggle:ace_core_components_toggle_$platform", 361 "$ace_root/frameworks/core/components/touch_listener:ace_core_components_touch_listener_$platform", 362 "$ace_root/frameworks/core/components/track:ace_core_components_track_$platform", 363 "$ace_root/frameworks/core/components/transform:ace_core_components_transform_$platform", 364 "$ace_root/frameworks/core/components/transition:ace_core_components_transition_$platform", 365 "$ace_root/frameworks/core/components/triangle:ace_core_components_triangle_$platform", 366 "$ace_root/frameworks/core/components/tween:ace_core_components_tween_$platform", 367 "$ace_root/frameworks/core/components/watch_slider:ace_core_components_watch_slider_$platform", 368 "$ace_root/frameworks/core/components/wrap:ace_core_components_wrap_$platform", 369 ] 370 371 if (defined(config.model_component_support) && 372 config.model_component_support) { 373 deps += [ 374 "$ace_root/frameworks/core/components/scene_viewer:ace_core_components_scene_viewer_$platform", 375 "$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_model_component_ng_$platform", 376 ] 377 } 378 379 deps += [ 380 "$ace_root/frameworks/core/components_v2/common:ace_core_components_common_v2_$platform", 381 "$ace_root/frameworks/core/components_v2/foreach:ace_core_components_foreach_v2_$platform", 382 "$ace_root/frameworks/core/components_v2/grid:ace_core_components_grid_v2_$platform", 383 "$ace_root/frameworks/core/components_v2/grid_layout:ace_core_components_grid_layout_v2_$platform", 384 "$ace_root/frameworks/core/components_v2/indexer:ace_core_components_indexer_v2_$platform", 385 "$ace_root/frameworks/core/components_v2/inspector:ace_core_components_inspector_v2_$platform", 386 "$ace_root/frameworks/core/components_v2/list:ace_core_components_list_v2_$platform", 387 "$ace_root/frameworks/core/components_v2/pattern_lock:ace_core_components_pattern_lock_$platform", 388 "$ace_root/frameworks/core/components_v2/swiper:ace_core_components_swiper_v2_$platform", 389 "$ace_root/frameworks/core/components_v2/tabs:ace_core_components_tabs_v2_$platform", 390 "$ace_root/frameworks/core/components_v2/water_flow:ace_core_components_water_flow_v2_$platform", 391 ] 392 393 deps += [ "$ace_root/frameworks/core/components_part_upd/foreach:ace_core_components_foreach_part_upd_$platform" ] 394 395 deps += [ 396 "$ace_root/frameworks/core/components_ng/animation:ace_core_components_animation_ng_$platform", 397 "$ace_root/frameworks/core/components_ng/base:ace_core_components_base_ng_$platform", 398 "$ace_root/frameworks/core/components_ng/event:ace_core_components_event_ng_$platform", 399 "$ace_root/frameworks/core/components_ng/gestures:ace_core_components_gestures_ng_$platform", 400 "$ace_root/frameworks/core/components_ng/image_provider:ace_core_components_image_provider_ng_$platform", 401 "$ace_root/frameworks/core/components_ng/layout:ace_core_components_layout_ng_$platform", 402 "$ace_root/frameworks/core/components_ng/manager:ace_core_components_manager_ng_$platform", 403 "$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_ng_$platform", 404 "$ace_root/frameworks/core/components_ng/property:ace_core_components_property_ng_$platform", 405 "$ace_root/frameworks/core/components_ng/render:ace_core_components_render_ng_$platform", 406 "$ace_root/frameworks/core/components_ng/svg:ace_core_components_svg_ng_$platform", 407 "$ace_root/frameworks/core/components_ng/syntax:ace_core_components_syntax_ng_$platform", 408 ] 409 if (defined(config.enable_ability_component) && 410 config.enable_ability_component) { 411 deps += [ "$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_ability_component_ng_$platform" ] 412 } 413 if (defined(config.enable_image_compression) && 414 config.enable_image_compression) { 415 deps += [ "//third_party/opencl-headers:libcl" ] 416 defines += [ "ENABLE_OPENCL" ] 417 } 418 419 if (current_os == "mingw" || current_os == "mac") { 420 sources -= [ "common/watch_dog.cpp" ] 421 sources += [ "common/watch_dog_mingw.cpp" ] 422 } 423 424 if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) { 425 sources += [ 426 "animation/native_curve_helper.cpp", 427 "common/rosen/rosen_convert_helper.cpp", 428 ] 429 if (is_ohos) { 430 external_deps += [ "graphic_2d:libtexgine" ] 431 defines += [ "TEXGINE_SUPPORT_FOR_OHOS" ] 432 } 433 if (is_arkui_x) { 434 deps += [ "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client_static" ] 435 } else { 436 if (ace_use_rosen_drawing) { 437 include_dirs += [ 438 "//foundation/graphic/graphic_2d/rosen/modules/2d_engine", 439 "//foundation/graphic/graphic_2d/rosen/modules/2d_engine/rosen_text", 440 ] 441 external_deps += [ "graphic_2d:2d_graphics" ] 442 } 443 external_deps += [ "graphic_2d:librender_service_client" ] 444 } 445 } 446 447 if (!use_mingw_win && !use_mac && !is_wearable_product && 448 !is_ohos_standard_system && !use_linux) { 449 deps += [ "$ace_root/frameworks/core/components/rich_text:ace_core_components_rich_text_$platform" ] 450 } 451 452 if (defined(config.web_components_support) && 453 config.web_components_support && !is_arkui_x) { 454 deps += [ 455 "$ace_root/frameworks/core/components/text_overlay:ace_core_components_text_overlay_for_web_$platform", 456 "$ace_root/frameworks/core/components/web:ace_core_components_web_$platform", 457 "$ace_root/frameworks/core/components_ng/pattern/web:ace_core_components_web_pattern_ng_$platform", 458 ] 459 } else { 460 deps += [ "$ace_root/frameworks/core/components/text_overlay:ace_core_components_text_overlay_$platform" ] 461 } 462 463 deps += [ 464 "$ace_root/frameworks/core/components_ng/pattern/patternlock:ace_core_components_patternlock_pattern_ng_$platform", 465 "$ace_root/frameworks/core/components_ng/pattern/qrcode:ace_core_components_qrcode_pattern_ng_$platform", 466 "$ace_root/frameworks/core/components_ng/pattern/text_field:ace_core_components_text_field_pattern_ng_$platform", 467 ] 468 469 deps += [ "$ace_root/frameworks/core/components_ng/pattern/security_component:ace_core_components_security_component_pattern_ng_$platform" ] 470 471 # xcomponent components supports phone, TV and wearable except PC Preview 472 if (defined(config.xcomponent_components_support) && 473 config.xcomponent_components_support) { 474 deps += [ "$ace_root/frameworks/core/components/xcomponent:ace_core_components_xcomponent_$platform" ] 475 } 476 477 if (defined(config.enable_ability_component) && 478 config.enable_ability_component) { 479 deps += [ "$ace_root/frameworks/core/components_v2/ability_component:ace_core_components_ability_v2_$platform" ] 480 } 481 482 if (defined(config.apng_image_support) && config.apng_image_support) { 483 defines += [ "APNG_IMAGE_SUPPORT" ] 484 deps += [ "$ace_root/frameworks/core/image/apng:ace_core_apng_$platform" ] 485 } 486 487 if (defined(config.form_components_support) && 488 config.form_components_support) { 489 if (!use_mingw_win && !use_mac && !use_linux) { 490 sources += [ "common/form_manager.cpp" ] 491 deps += [ 492 "$ace_root/frameworks/core/components/form:ace_core_components_form_$platform", 493 "$ace_root/frameworks/core/components_ng/pattern/form:ace_core_components_form_pattern_ng_$platform", 494 ] 495 external_deps += [ "form_fwk:form_manager" ] 496 } 497 } 498 499 if (defined(config.enable_drag_framework) && config.enable_drag_framework) { 500 sources += [ "gestures/gesture_info.cpp" ] 501 } 502 503 if (defined(config.remote_window_support) && config.remote_window_support) { 504 if (!use_mingw_win && !use_mac && !use_linux) { 505 deps += [ 506 "$ace_root/frameworks/core/components/remote_window:ace_core_components_remote_window_$platform", 507 "$ace_root/frameworks/core/components_ng/pattern/remote_window:ace_core_components_remote_window_pattern_ng_$platform", 508 ] 509 } 510 } 511 512 if (defined(config.build_container_scope_lib) && 513 config.build_container_scope_lib) { 514 sources -= [ "common/container_scope.cpp" ] 515 if (is_arkui_x) { 516 deps += [ "$ace_napi:ace_container_scope_static" ] 517 } else { 518 external_deps += [ "napi:ace_container_scope" ] 519 } 520 } 521 522 if (defined(config.plugin_components_support) && 523 config.plugin_components_support) { 524 deps += [ 525 "$ace_root/frameworks/core/components/plugin:ace_core_components_plugin_$platform", 526 "$ace_root/frameworks/core/components_ng/pattern/plugin:ace_core_components_plugin_pattern_ng_$platform", 527 ] 528 sources += [ "common/plugin_manager.cpp" ] 529 external_deps += [ "c_utils:utils" ] 530 } 531 532 if (defined(config.preview_support) && config.preview_support) { 533 deps += [ "$ace_root/frameworks/core/components_ng/pattern/preview_mock:ace_core_components_preview_mock_pattern_ng_$platform" ] 534 } 535 536 include_dirs += 537 [ "//foundation/window/window_manager/interfaces/innerkits" ] 538 if (is_arkui_x) { 539 include_dirs += [ 540 "//foundation/appframework/ability/ability_runtime/cross_platform/frameworks/native/base/event_handler/include", 541 "//foundation/appframework/ability/ability_runtime/cross_platform/interfaces/inner_api/error", 542 ] 543 } 544 if (!is_wearable_product) { 545 deps += [ 546 "$ace_root/frameworks/core/components/camera:ace_core_components_camera_$platform", 547 "$ace_root/frameworks/core/components/multimodal:ace_core_components_multimodal_$platform", 548 "$ace_root/frameworks/core/components/piece:ace_core_components_piece_$platform", 549 "$ace_root/frameworks/core/components/popup:ace_core_components_popup_$platform", 550 "$ace_root/frameworks/core/components/rating:ace_core_components_rating_$platform", 551 "$ace_root/frameworks/core/components/select:ace_core_components_select_$platform", 552 "$ace_root/frameworks/core/components/tool_bar:ace_core_components_tool_bar_$platform", 553 "$ace_root/frameworks/core/components/video:ace_core_components_video_$platform", 554 ] 555 } 556 557 if ((current_os == "mingw" || current_os == "mac" || 558 current_os == "linux") && defined(config.enable_rosen_backend) && 559 config.enable_rosen_backend) { 560 sources -= [ "common/flutter/flutter_asset_manager.cpp" ] 561 sources += [ 562 # rs impl 563 "common/rosen/rosen_asset_manager.cpp", 564 "common/rosen/rosen_window.cpp", 565 ] 566 deps += [ "//third_party/libuv:uv" ] 567 } 568 569 if (defined(config.window_scene_support) && config.window_scene_support) { 570 deps += [ 571 "$ace_root/frameworks/core/components_ng/pattern/ui_extension:ace_core_components_ui_extension_pattern_ng_$platform", 572 "$ace_root/frameworks/core/components_ng/pattern/window_scene:ace_core_components_window_scene_$platform", 573 ] 574 } 575 576 cflags_cc = [] 577 cflags_cc += invoker.cflags_cc 578 } 579} 580 581# build ng core sources 582template("ace_core_ng_source_set") { 583 forward_variables_from(invoker, "*") 584 585 ohos_source_set(target_name) { 586 if (current_os == "ohos") { 587 sanitize = { 588 integer_overflow = true 589 boundary_sanitize = true 590 debug = ace_sanitize_debug 591 } 592 } 593 subsystem_name = ace_engine_subsystem 594 part_name = ace_engine_part 595 defines += invoker.defines 596 platform = invoker.platform 597 598 # add common source file needed by all product platform here 599 sources = [ 600 # accessibility 601 "accessibility/accessibility_node.cpp", 602 "accessibility/accessibility_utils.cpp", 603 604 # animation 605 "animation/animatable_data.cpp", 606 "animation/animatable_properties.cpp", 607 "animation/animation_util.cpp", 608 "animation/animator.cpp", 609 "animation/animator_group.cpp", 610 "animation/anticipate_curve.cpp", 611 "animation/bilateral_spring_adapter.cpp", 612 "animation/bilateral_spring_node.cpp", 613 "animation/card_transition_controller.cpp", 614 "animation/chain_animation.cpp", 615 "animation/cubic_curve.cpp", 616 "animation/curves.cpp", 617 "animation/friction_motion.cpp", 618 "animation/property_animation.cpp", 619 "animation/scheduler.cpp", 620 "animation/scroll_motion.cpp", 621 "animation/simple_spring_adapter.cpp", 622 "animation/simple_spring_chain.cpp", 623 "animation/simple_spring_node.cpp", 624 "animation/spring_animation.cpp", 625 "animation/spring_curve.cpp", 626 "animation/spring_model.cpp", 627 "animation/spring_motion.cpp", 628 "animation/svg_animate.cpp", 629 630 # common 631 "common/ace_application_info.cpp", 632 "common/ace_engine.cpp", 633 "common/ace_engine_ext.cpp", 634 "common/anr_thread.cpp", 635 "common/card_scope.cpp", 636 "common/clipboard/clipboard_proxy.cpp", 637 "common/container.cpp", 638 "common/container_scope.cpp", 639 "common/environment/environment_proxy.cpp", 640 "common/event_manager.cpp", 641 "common/focus_animation_manager.cpp", 642 "common/font_loader.cpp", 643 "common/font_manager.cpp", 644 "common/frontend.cpp", 645 "common/platform_bridge.cpp", 646 "common/sharedata/share_data.cpp", 647 "common/storage/storage_proxy.cpp", 648 "common/text_field_manager.cpp", 649 "common/thread_checker.cpp", 650 "common/vibrator/vibrator_proxy.cpp", 651 "common/watch_dog.cpp", 652 "common/window.cpp", 653 654 # event 655 "event/back_end_event_manager.cpp", 656 "event/event_convertor.cpp", 657 "event/key_event.cpp", 658 "event/key_event_recognizer.cpp", 659 "event/mouse_raw_recognizer.cpp", 660 661 # gestures 662 "gestures/click_recognizer.cpp", 663 "gestures/drag_recognizer.cpp", 664 "gestures/exclusive_recognizer.cpp", 665 "gestures/gesture_recognizer.cpp", 666 "gestures/gesture_referee.cpp", 667 "gestures/long_press_recognizer.cpp", 668 "gestures/multi_fingers_recognizer.cpp", 669 "gestures/pan_recognizer.cpp", 670 "gestures/parallel_recognizer.cpp", 671 "gestures/pinch_recognizer.cpp", 672 "gestures/press_recognizer.cpp", 673 "gestures/raw_recognizer.cpp", 674 "gestures/rotation_recognizer.cpp", 675 "gestures/sequenced_recognizer.cpp", 676 "gestures/single_child_gesture.cpp", 677 "gestures/slide_recognizer.cpp", 678 "gestures/swipe_recognizer.cpp", 679 "gestures/timeout_recognizer.cpp", 680 "gestures/velocity_tracker.cpp", 681 682 # declarative gestures 683 "gestures/gesture_group.cpp", 684 "gestures/long_press_gesture.cpp", 685 "gestures/pan_gesture.cpp", 686 "gestures/pinch_gesture.cpp", 687 "gestures/rotation_gesture.cpp", 688 "gestures/slide_gesture.cpp", 689 "gestures/tap_gesture.cpp", 690 "gestures/timeout_gesture.cpp", 691 692 # pipeline 693 "pipeline/base/constants.cpp", 694 "pipeline/base/element_register.cpp", 695 "pipeline/base/related_node.cpp", 696 "pipeline/pipeline_base.cpp", 697 698 # image 699 "image/animated_image_player.cpp", 700 "image/flutter_image_cache.cpp", 701 "image/image_cache.cpp", 702 "image/image_compressor.cpp", 703 "image/image_loader.cpp", 704 "image/image_object.cpp", 705 "image/image_object_animated.cpp", 706 "image/image_object_svg.cpp", 707 "image/image_provider.cpp", 708 "image/image_source_info.cpp", 709 710 # textfield 711 "common/ime/text_editing_value.cpp", 712 "common/ime/text_input_action.cpp", 713 "common/ime/text_input_configuration.cpp", 714 "common/ime/text_input_connection.cpp", 715 "common/ime/text_input_formatter.cpp", 716 "common/ime/text_input_proxy.cpp", 717 "common/ime/text_input_type.cpp", 718 719 # properties 720 "components/common/painter/rosen_decoration_painter.cpp", 721 "components/common/properties/alignment.cpp", 722 "components/common/properties/animatable_path.cpp", 723 "components/common/properties/border.cpp", 724 "components/common/properties/border_edge.cpp", 725 "components/common/properties/border_image.cpp", 726 "components/common/properties/border_image_edge.cpp", 727 "components/common/properties/clip_path.cpp", 728 "components/common/properties/color.cpp", 729 "components/common/properties/color_factory.cpp", 730 "components/common/properties/decoration.cpp", 731 "components/common/properties/edge.cpp", 732 "components/common/properties/motion_path_evaluator.cpp", 733 "components/common/properties/page_transition_option.cpp", 734 "components/common/properties/scroll_bar.cpp", 735 "components/common/properties/shadow.cpp", 736 "components/common/properties/shadow_config.cpp", 737 "components/common/properties/text_style.cpp", 738 "components/common/properties/text_style_parser.cpp", 739 740 # layout 741 "components/common/layout/grid_column_info.cpp", 742 "components/common/layout/grid_container_info.cpp", 743 "components/common/layout/grid_system_manager.cpp", 744 "components/common/layout/screen_system_manager.cpp", 745 746 # v1 deps 747 "$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp", 748 "$root_out_dir/arkui/framework/core/components/theme/theme_constants_tv.cpp", 749 "components/common/painter/flutter_decoration_painter.cpp", 750 "components/common/painter/flutter_svg_painter.cpp", 751 "components/custom_paint/render_custom_paint_creator.cpp", 752 "components/custom_paint/render_offscreen_canvas_creator.cpp", 753 "components/custom_paint/rosen_render_custom_paint.cpp", 754 "components/custom_paint/rosen_render_offscreen_canvas.cpp", 755 "components/declaration/common/event.cpp", 756 "components/font/constants_converter.cpp", 757 "components/font/flutter_font_collection.cpp", 758 "components/font/font_loader_creator.cpp", 759 "components/font/font_manager_creator.cpp", 760 "components/font/rosen_font_collection.cpp", 761 "components/font/rosen_font_loader.cpp", 762 "components/font/rosen_font_manager.cpp", 763 "components/panel/sliding_events.cpp", 764 "components/picker/picker_animation.cpp", 765 "components/picker/picker_data.cpp", 766 "components/scroll/scrollable.cpp", 767 "components/svg/svg_transform.cpp", 768 "components/theme/app_theme.cpp", 769 "components/theme/icon_theme.cpp", 770 "components/theme/theme_attributes.cpp", 771 "components/theme/theme_constants.cpp", 772 "components/theme/theme_manager_impl.cpp", 773 "components/theme/theme_utils.cpp", 774 "components/video/resource/ext_surface.cpp", 775 "components/video/resource/player.cpp", 776 "components/video/resource/resource.cpp", 777 778 # v2 inspector 779 "components_v2/grid/grid_event.cpp", 780 "components_v2/grid_layout/grid_container_utils.cpp", 781 "components_v2/inspector/inspector_constants.cpp", 782 "components_v2/inspector/utils.cpp", 783 784 # flutter impl 785 "common/flutter/flutter_asset_manager.cpp", 786 "common/flutter/flutter_task_executor.cpp", 787 "common/flutter/flutter_thread_model.cpp", 788 ] 789 include_dirs = [] 790 if (is_arkui_x) { 791 include_dirs += [ 792 "//foundation/appframework/ability/ability_runtime/cross_platform/frameworks/native/base/event_handler/include", 793 "//foundation/appframework/ability/ability_runtime/cross_platform/interfaces/inner_api/error", 794 ] 795 } 796 797 if (platform == "ohos") { 798 sources -= [ "common/anr_thread.cpp" ] 799 } 800 801 configs = [ "$ace_root:ace_config" ] 802 803 deps = [ 804 "$ace_root/frameworks/core/components/theme:build_theme_code", 805 "pipeline_ng:ace_core_pipeline_ng_$platform", 806 ] 807 external_deps = [] 808 if (ace_use_new_skia) { 809 configs += [ "$ace_flutter_engine_root:flutter_config" ] 810 811 if (is_arkui_x) { 812 sources += [ "components/common/painter/rosen_svg_painter.cpp" ] 813 814 sources -= [ 815 "components/common/painter/flutter_decoration_painter.cpp", 816 "components/common/painter/flutter_svg_painter.cpp", 817 "components/font/flutter_font_collection.cpp", 818 ] 819 820 deps += [ "$ace_flutter_engine_root:flutter_for_ng" ] 821 } 822 823 deps += [ 824 "$ace_flutter_engine_root/libtxt:thirdparty_lib_txt_$platform", 825 "$skia_root_new:skia_$platform", 826 ] 827 } else { 828 deps += [ 829 "$ace_flutter_engine_root:third_party_flutter_engine_$platform", 830 "$ace_flutter_engine_root/skia:ace_skia_$platform", 831 ] 832 } 833 834 if (defined(config.enable_drag_framework) && config.enable_drag_framework) { 835 sources += [ "gestures/gesture_info.cpp" ] 836 } 837 838 if (defined(config.build_container_scope_lib) && 839 config.build_container_scope_lib) { 840 sources -= [ "common/container_scope.cpp" ] 841 if (is_arkui_x) { 842 deps += [ "$ace_napi:ace_container_scope_static" ] 843 } else { 844 external_deps += [ "napi:ace_container_scope" ] 845 } 846 } 847 deps += [ 848 "$ace_root/frameworks/core/components_ng/animation:ace_core_components_animation_ng_$platform", 849 "$ace_root/frameworks/core/components_ng/base:ace_core_components_base_ng_$platform", 850 "$ace_root/frameworks/core/components_ng/event:ace_core_components_event_ng_$platform", 851 "$ace_root/frameworks/core/components_ng/gestures:ace_core_components_gestures_ng_$platform", 852 "$ace_root/frameworks/core/components_ng/image_provider:ace_core_components_image_provider_ng_$platform", 853 "$ace_root/frameworks/core/components_ng/layout:ace_core_components_layout_ng_$platform", 854 "$ace_root/frameworks/core/components_ng/manager:ace_core_components_manager_ng_$platform", 855 "$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_ng_$platform", 856 "$ace_root/frameworks/core/components_ng/pattern/text_field:ace_core_components_text_field_pattern_ng_$platform", 857 "$ace_root/frameworks/core/components_ng/property:ace_core_components_property_ng_$platform", 858 "$ace_root/frameworks/core/components_ng/render:ace_core_components_render_ng_$platform", 859 "$ace_root/frameworks/core/components_ng/syntax:ace_core_components_syntax_ng_$platform", 860 ] 861 862 if (defined(config.use_components_lib) && config.use_components_lib) { 863 deps += [ "$ace_root/frameworks/core/components_ng/common_napi_utils:ace_core_components_common_napi_utils_$platform" ] 864 } else { 865 deps += [ 866 "$ace_root/frameworks/core/components_ng/pattern/patternlock:ace_core_components_patternlock_pattern_ng_$platform", 867 "$ace_root/frameworks/core/components_ng/pattern/qrcode:ace_core_components_qrcode_pattern_ng_$platform", 868 ] 869 } 870 871 if (defined(config.enable_ability_component) && 872 config.enable_ability_component) { 873 deps += [ "$ace_root/frameworks/core/components_ng/pattern:ace_core_components_pattern_ability_component_ng_$platform" ] 874 } 875 if (defined(config.web_components_support) && 876 config.web_components_support) { 877 if (!is_arkui_x) { 878 include_dirs += [ 879 "$ability_runtime_path/interfaces/kits/native/appkit/app", 880 "//foundation/window/window_manager/interfaces/innerkits/wm", 881 "//foundation/graphic/graphic_2d/utils/buffer_handle/export", 882 ] 883 deps += [ "$ace_root/frameworks/core/components_ng/pattern/web:ace_core_components_web_pattern_ng_$platform" ] 884 sources += [ 885 "components/web/resource/web_client_impl.cpp", 886 "components/web/resource/web_configuration_observer.cpp", 887 "components/web/resource/web_delegate.cpp", 888 "components/web/resource/web_javascript_result_callback.cpp", 889 "components/web/resource/web_resource.cpp", 890 "components/web/web_component.cpp", 891 ] 892 893 external_deps += [ 894 "ability_base:base", 895 "ability_base:configuration", 896 "ability_runtime:app_manager", 897 "ability_runtime:appkit_native", 898 "c_utils:utils", 899 "graphic_2d:surface", 900 "init:libbegetutil", 901 "ipc:ipc_core", 902 "webview:libnweb", 903 "window_manager:libwm", 904 ] 905 } else { 906 deps += [ "$ace_root/frameworks/core/components_ng/pattern/web:ace_core_components_web_pattern_ng_$platform" ] 907 } 908 } 909 if (defined(config.form_components_support) && 910 config.form_components_support) { 911 if (!use_mingw_win && !use_mac && !use_linux) { 912 deps += [ "$ace_root/frameworks/core/components_ng/pattern/form:ace_core_components_form_pattern_ng_$platform" ] 913 } 914 } 915 if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) { 916 sources += [ 917 "animation/native_curve_helper.cpp", 918 "common/rosen/rosen_convert_helper.cpp", 919 ] 920 include_dirs += [ 921 "//foundation/graphic/graphic_2d/rosen/modules/2d_engine", 922 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/include", 923 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src", 924 "//foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src/drawing/engine_adapter", 925 ] 926 if (is_ohos) { 927 external_deps += [ "graphic_2d:libtexgine" ] 928 defines += [ "TEXGINE_SUPPORT_FOR_OHOS" ] 929 } 930 if (is_arkui_x) { 931 deps += [ "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client_static" ] 932 } else { 933 external_deps += [ "graphic_2d:librender_service_client" ] 934 if (ace_use_rosen_drawing) { 935 external_deps += [ "graphic_2d:2d_graphics" ] 936 } 937 } 938 } 939 cflags_cc = [] 940 cflags_cc += invoker.cflags_cc 941 } 942} 943 944foreach(item, ace_platforms) { 945 ace_core_source_set("ace_core_" + item.name) { 946 platform = item.name 947 948 if (defined(item.config)) { 949 config = item.config 950 } else { 951 config = { 952 } 953 } 954 955 if (defined(config.defines)) { 956 defines = config.defines 957 } else { 958 defines = [] 959 } 960 961 if (defined(config.cflags_cc)) { 962 cflags_cc = config.cflags_cc 963 } else { 964 cflags_cc = [] 965 } 966 } 967 968 ace_core_ng_source_set("ace_core_ng_" + item.name) { 969 platform = item.name 970 971 if (defined(item.config)) { 972 config = item.config 973 } else { 974 config = { 975 } 976 } 977 978 if (defined(config.defines)) { 979 defines = config.defines 980 } else { 981 defines = [] 982 } 983 984 if (defined(config.cflags_cc)) { 985 cflags_cc = config.cflags_cc 986 } else { 987 cflags_cc = [] 988 } 989 } 990} 991