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 17ohos_source_set("preview_entrance_source") { 18 subsystem_name = ace_engine_subsystem 19 part_name = ace_engine_part 20 if (defined(current_platform.name)) { 21 platform = current_platform.name 22 defines = [] 23 cflags_cc = [] 24 config = { 25 } 26 if (defined(current_platform.config)) { 27 config = current_platform.config 28 } 29 if (defined(config.defines)) { 30 defines += config.defines 31 } 32 if (defined(config.cflags_cc)) { 33 cflags_cc += config.cflags_cc 34 } 35 configs = [ "$ace_root:ace_config" ] 36 37 # set icu_data_path for ark preview 38 defines += [ "INIT_ICU_DATA_PATH" ] 39 40 sources = [ 41 "$ace_root/adapter/ohos/entrance/ace_new_pipe_judgement.cpp", 42 "ace_ability.cpp", 43 "ace_application_info.cpp", 44 "ace_container.cpp", 45 "ace_preview_helper.cpp", 46 "ace_resource_register.cpp", 47 "ace_translate_manager.cpp", 48 "ace_view_preview.cpp", 49 "clipboard/clipboard_impl.cpp", 50 "clipboard/clipboard_proxy_impl.cpp", 51 "clipboard/multiType_record_impl.cpp", 52 "editing/text_input_client_mgr.cpp", 53 "editing/text_input_connection_impl.cpp", 54 "editing/text_input_impl.cpp", 55 "event_dispatcher.cpp", 56 "foldable_window_preview.cpp", 57 "html/html_to_span.cpp", 58 "html/span_to_html.cpp", 59 "msdp/interaction_impl.cpp", 60 "picker/picker_haptic_factory.cpp", 61 "report/reporter_impl.cpp", 62 "subwindow_preview.cpp", 63 "touch_event_convertor.cpp", 64 "udmf/udmf_impl.cpp", 65 "ui_content_impl.cpp", 66 "ui_session/ui_session_json_util.cpp", 67 "ui_session/ui_session_manager_preview.cpp", 68 "vibrator/vibrator_utils.cpp", 69 "window_free_container.cpp", 70 "xcollie/xcollieInterface_impl.cpp", 71 ] 72 73 deps = [ 74 "$ace_napi:ace_napi", 75 "$ace_root/frameworks/core/components/theme:build_theme_code", 76 "$ace_root/interfaces/inner_api/ace:ace_uicontent", 77 ] 78 external_deps = [] 79 include_dirs = [ 80 "//foundation/window/window_manager", 81 "//foundation/ability/ability_runtime", 82 "//arkcompiler/ets_runtime", 83 "//arkcompiler/runtime_core", 84 ] 85 86 if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) { 87 external_deps += [ 88 "graphic_2d:librender_service_client", 89 "window_manager:previewer_window", 90 ] 91 if (ace_use_rosen_drawing) { 92 external_deps += [ "graphic_2d:2d_graphics" ] 93 } 94 } 95 96 if (defined(config.enable_component_test) && config.enable_component_test && 97 platform == "windows") { 98 sources += [ 99 "$ace_root/frameworks/component_test/component_test_manager_impl.cpp", 100 "$ace_root/frameworks/component_test/component_test_proxy.cpp", 101 "$ace_root/frameworks/component_test/core/action.cpp", 102 "$ace_root/frameworks/component_test/core/combination_isscrollable.cpp", 103 "$ace_root/frameworks/component_test/core/component_test_component_impl.cpp", 104 "$ace_root/frameworks/component_test/core/component_test_matcher_impl.cpp", 105 "$ace_root/frameworks/component_test/core/component_test_tester_impl.cpp", 106 "$ace_root/frameworks/component_test/idle_watcher.cpp", 107 "$ace_root/frameworks/component_test/test_config.cpp", 108 "$ace_root/frameworks/component_test/test_result_recorder.cpp", 109 "$ace_root/frameworks/component_test/test_task_scheduler.cpp", 110 ] 111 } 112 113 if (!is_arkui_x) { 114 if (platform == "windows") { 115 defines -= [ "UNICODE" ] 116 deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_win" ] 117 cflags_cc += [ "-DNONLS" ] 118 } 119 120 if (platform == "mac") { 121 deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_mac" ] 122 } 123 124 if (platform == "linux") { 125 deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_linux" ] 126 } 127 } 128 } 129} 130