• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 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
17template("bridge_common") {
18  forward_variables_from(invoker, "*")
19
20  ohos_source_set(target_name) {
21    subsystem_name = ace_engine_subsystem
22    part_name = ace_engine_part
23    defines += invoker.defines
24
25    configs = [ "$ace_root:ace_config" ]
26
27    sources = [
28      # dom
29      "dom/dom_badge.cpp",
30      "dom/dom_button.cpp",
31      "dom/dom_calendar.cpp",
32      "dom/dom_canvas.cpp",
33      "dom/dom_chart.cpp",
34      "dom/dom_clock.cpp",
35      "dom/dom_dialog.cpp",
36      "dom/dom_div.cpp",
37      "dom/dom_divider.cpp",
38      "dom/dom_document.cpp",
39      "dom/dom_form.cpp",
40      "dom/dom_grid_column.cpp",
41      "dom/dom_grid_container.cpp",
42      "dom/dom_grid_row.cpp",
43      "dom/dom_image.cpp",
44      "dom/dom_image_animator.cpp",
45      "dom/dom_input.cpp",
46      "dom/dom_label.cpp",
47      "dom/dom_list.cpp",
48      "dom/dom_list_item.cpp",
49      "dom/dom_list_item_group.cpp",
50      "dom/dom_marquee.cpp",
51      "dom/dom_navigation_bar.cpp",
52      "dom/dom_node.cpp",
53      "dom/dom_panel.cpp",
54      "dom/dom_picker_base.cpp",
55      "dom/dom_picker_view.cpp",
56      "dom/dom_progress.cpp",
57      "dom/dom_proxy.cpp",
58      "dom/dom_refresh.cpp",
59      "dom/dom_search.cpp",
60      "dom/dom_slider.cpp",
61      "dom/dom_span.cpp",
62      "dom/dom_stack.cpp",
63      "dom/dom_svg.cpp",
64      "dom/dom_svg_animate.cpp",
65      "dom/dom_svg_animate_motion.cpp",
66      "dom/dom_svg_animate_transform.cpp",
67      "dom/dom_svg_base.cpp",
68      "dom/dom_svg_circle.cpp",
69      "dom/dom_svg_defs.cpp",
70      "dom/dom_svg_ellipse.cpp",
71      "dom/dom_svg_fe_colormatrix.cpp",
72      "dom/dom_svg_fe_composite.cpp",
73      "dom/dom_svg_fe_gaussianblur.cpp",
74      "dom/dom_svg_fe_offset.cpp",
75      "dom/dom_svg_filter.cpp",
76      "dom/dom_svg_g.cpp",
77      "dom/dom_svg_line.cpp",
78      "dom/dom_svg_mask.cpp",
79      "dom/dom_svg_path.cpp",
80      "dom/dom_svg_polygon.cpp",
81      "dom/dom_svg_polyline.cpp",
82      "dom/dom_svg_rect.cpp",
83      "dom/dom_svg_text.cpp",
84      "dom/dom_svg_text_path.cpp",
85      "dom/dom_svg_tspan.cpp",
86      "dom/dom_svg_use.cpp",
87      "dom/dom_swiper.cpp",
88      "dom/dom_switch.cpp",
89      "dom/dom_tab_bar.cpp",
90      "dom/dom_tab_content.cpp",
91      "dom/dom_tabs.cpp",
92      "dom/dom_text.cpp",
93      "dom/dom_textarea.cpp",
94      "dom/dom_toggle.cpp",
95      "dom/dom_type.cpp",
96      "dom/input/dom_button_util.cpp",
97      "dom/input/dom_checkbox_util.cpp",
98      "dom/input/dom_radio_util.cpp",
99      "dom/input/dom_textfield_util.cpp",
100
101      # manifest
102      "manifest/manifest_appinfo.cpp",
103      "manifest/manifest_parser.cpp",
104      "manifest/manifest_router.cpp",
105      "manifest/manifest_widget.cpp",
106      "manifest/manifest_window.cpp",
107
108      # media query
109      "media_query/media_query_info.cpp",
110      "media_query/media_queryer.cpp",
111
112      # plugin adapter
113      "plugin_adapter/plugin_bridge.cpp",
114
115      # utils
116      "utils/engine_helper.cpp",
117      "utils/source_map.cpp",
118      "utils/transform_convertor.cpp",
119      "utils/utils.cpp",
120    ]
121
122    if (qrcodegen_support) {
123      sources += [ "dom/dom_qrcode.cpp" ]
124    }
125
126    # rich components needed by phone and TV. wearable like watch do not need them
127    if (defined(config.rich_components_support) &&
128        config.rich_components_support) {
129      sources += [
130        "dom/dom_camera.cpp",
131        "dom/dom_menu.cpp",
132        "dom/dom_navigation_menu.cpp",
133        "dom/dom_option.cpp",
134        "dom/dom_picker_dialog.cpp",
135        "dom/dom_piece.cpp",
136        "dom/dom_popup.cpp",
137        "dom/dom_rating.cpp",
138        "dom/dom_select.cpp",
139        "dom/dom_stepper.cpp",
140        "dom/dom_stepper_item.cpp",
141        "dom/dom_tool_bar.cpp",
142        "dom/dom_tool_bar_item.cpp",
143        "dom/dom_video.cpp",
144      ]
145    }
146
147    # xcomponent components supports phone, TV and wearable except PC Preview
148    if (defined(config.xcomponent_components_support) &&
149        config.xcomponent_components_support) {
150      sources += [ "dom/dom_xcomponent.cpp" ]
151    }
152
153    # advance components using web or native plugins
154    if (defined(config.advance_components_support) &&
155        config.advance_components_support && !is_arkui_x) {
156      sources += [
157        "dom/dom_rich_text.cpp",
158        "dom/dom_web.cpp",
159      ]
160    }
161
162    if (defined(config.web_components_support) &&
163        config.web_components_support && !is_arkui_x) {
164      sources += [
165        "dom/dom_rich_text.cpp",
166        "dom/dom_web.cpp",
167      ]
168    }
169
170    deps = [ "$ace_root/frameworks/core/components/theme:build_theme_code" ]
171    if (use_hilog) {
172      external_deps = [ "hilog:libhilog" ]
173    }
174  }
175}
176
177template("bridge_common_ng") {
178  forward_variables_from(invoker, "*")
179
180  ohos_source_set(target_name) {
181    subsystem_name = ace_engine_subsystem
182    part_name = ace_engine_part
183    defines += invoker.defines
184
185    configs = [ "$ace_root:ace_config" ]
186
187    sources = [
188      # manifest
189      "dom/dom_type.cpp",
190      "manifest/manifest_appinfo.cpp",
191      "manifest/manifest_parser.cpp",
192      "manifest/manifest_router.cpp",
193      "manifest/manifest_widget.cpp",
194      "manifest/manifest_window.cpp",
195
196      # media query
197      "media_query/media_query_info.cpp",
198      "media_query/media_queryer.cpp",
199
200      # plugin adapter
201      "plugin_adapter/plugin_bridge.cpp",
202
203      # utils
204      "../js_frontend/engine/common/js_constants.cpp",
205      "../js_frontend/frontend_delegate.cpp",
206      "../js_frontend/js_ace_page.cpp",
207      "utils/engine_helper.cpp",
208      "utils/source_map.cpp",
209      "utils/utils.cpp",
210    ]
211
212    deps = [ "$ace_root/frameworks/core/components/theme:build_theme_code" ]
213    if (use_hilog) {
214      external_deps = [ "hilog:libhilog" ]
215    }
216  }
217}
218
219foreach(item, ace_platforms) {
220  bridge_common("bridge_common_" + item.name) {
221    defines = []
222    config = {
223    }
224
225    if (defined(item.config)) {
226      config = item.config
227    }
228
229    if (defined(config.defines)) {
230      defines = config.defines
231    }
232  }
233
234  bridge_common_ng("bridge_common_ng_" + item.name) {
235    defines = []
236    config = {
237    }
238
239    if (defined(item.config)) {
240      config = item.config
241    }
242
243    if (defined(config.defines)) {
244      defines = config.defines
245    }
246  }
247}
248