• 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")
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      "subwindow_preview.cpp",
62      "touch_event_convertor.cpp",
63      "udmf/udmf_impl.cpp",
64      "ui_content_impl.cpp",
65      "ui_session/ui_session_manager_preview.cpp",
66      "vibrator/vibrator_utils.cpp",
67      "window_free_container.cpp",
68      "xcollie/xcollieInterface_impl.cpp",
69    ]
70
71    deps = [
72      "$ace_napi:ace_napi",
73      "$ace_root/frameworks/core/components/theme:build_theme_code",
74      "$ace_root/interfaces/inner_api/ace:ace_uicontent",
75    ]
76    external_deps = []
77    include_dirs = [
78      "//foundation/window/window_manager",
79      "//foundation/ability/ability_runtime",
80      "//arkcompiler/ets_runtime",
81      "//arkcompiler/runtime_core",
82    ]
83
84    if (defined(config.enable_rosen_backend) && config.enable_rosen_backend) {
85      external_deps += [
86        "graphic_2d:librender_service_client",
87        "window_manager:previewer_window",
88      ]
89      if (ace_use_rosen_drawing) {
90        external_deps += [ "graphic_2d:2d_graphics" ]
91      }
92    }
93
94    if (defined(config.enable_component_test) && config.enable_component_test &&
95        platform == "windows") {
96      sources += [
97        "$ace_root/frameworks/component_test/component_test_manager_impl.cpp",
98        "$ace_root/frameworks/component_test/component_test_proxy.cpp",
99        "$ace_root/frameworks/component_test/core/action.cpp",
100        "$ace_root/frameworks/component_test/core/combination_isscrollable.cpp",
101        "$ace_root/frameworks/component_test/core/component_test_component_impl.cpp",
102        "$ace_root/frameworks/component_test/core/component_test_matcher_impl.cpp",
103        "$ace_root/frameworks/component_test/core/component_test_tester_impl.cpp",
104        "$ace_root/frameworks/component_test/idle_watcher.cpp",
105        "$ace_root/frameworks/component_test/test_config.cpp",
106        "$ace_root/frameworks/component_test/test_result_recorder.cpp",
107        "$ace_root/frameworks/component_test/test_task_scheduler.cpp",
108      ]
109    }
110
111    if (!is_arkui_x) {
112      if (platform == "windows") {
113        defines -= [ "UNICODE" ]
114        deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_win" ]
115        cflags_cc += [ "-DNONLS" ]
116      }
117
118      if (platform == "mac") {
119        deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_mac" ]
120      }
121
122      if (platform == "linux") {
123        deps += [ "//base/global/resource_management/frameworks/resmgr:global_resmgr_linux" ]
124      }
125    }
126  }
127}
128