• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 # Copyright (c) 2021 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 
14 import("//build/ohos.gni")
15 import("//build/ohos/notice/notice.gni")
16 import("//build/templates/metadata/module_info.gni")
17 
18 ohos_copy("ets_internal_api") {
19   sources = [
20     "api/@internal/ets/index.d.ts",
21     "api/@internal/ets/lifecycle.d.ts",
22     "api/@internal/global.d.ts",
23   ]
24   outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
25   module_source_dir = target_out_dir + "/$target_name"
26   module_install_name = ""
27 }
28 
29 ohos_copy("ets_component") {
30   sources = [
31     "api/@internal/component/ets/ability_component.d.ts",
32     "api/@internal/component/ets/action_sheet.d.ts",
33     "api/@internal/component/ets/alert_dialog.d.ts",
34     "api/@internal/component/ets/alphabet_indexer.d.ts",
35     "api/@internal/component/ets/animator.d.ts",
36     "api/@internal/component/ets/badge.d.ts",
37     "api/@internal/component/ets/blank.d.ts",
38     "api/@internal/component/ets/button.d.ts",
39     "api/@internal/component/ets/calendar.d.ts",
40     "api/@internal/component/ets/camera.d.ts",
41     "api/@internal/component/ets/circle.d.ts",
42     "api/@internal/component/ets/column.d.ts",
43     "api/@internal/component/ets/column_split.d.ts",
44     "api/@internal/component/ets/common.d.ts",
45     "api/@internal/component/ets/counter.d.ts",
46     "api/@internal/component/ets/custom_dialog_controller.d.ts",
47     "api/@internal/component/ets/datapanel.d.ts",
48     "api/@internal/component/ets/datePicker.d.ts",
49     "api/@internal/component/ets/divider.d.ts",
50     "api/@internal/component/ets/ellipse.d.ts",
51     "api/@internal/component/ets/flex.d.ts",
52     "api/@internal/component/ets/forEach.d.ts",
53     "api/@internal/component/ets/form_component.d.ts",
54     "api/@internal/component/ets/gauge.d.ts",
55     "api/@internal/component/ets/geometryView.d.ts",
56     "api/@internal/component/ets/gesture.d.ts",
57     "api/@internal/component/ets/grid.d.ts",
58     "api/@internal/component/ets/gridItem.d.ts",
59     "api/@internal/component/ets/grid_container.d.ts",
60     "api/@internal/component/ets/hyperlink.d.ts",
61     "api/@internal/component/ets/image.d.ts",
62     "api/@internal/component/ets/image_animator.d.ts",
63     "api/@internal/component/ets/index.d.ts",
64     "api/@internal/component/ets/lazyForEach.d.ts",
65     "api/@internal/component/ets/line.d.ts",
66     "api/@internal/component/ets/list.d.ts",
67     "api/@internal/component/ets/listItem.d.ts",
68     "api/@internal/component/ets/loadingProgress.d.ts",
69     "api/@internal/component/ets/marquee.d.ts",
70     "api/@internal/component/ets/menu.d.ts",
71     "api/@internal/component/ets/navigator.d.ts",
72     "api/@internal/component/ets/navigatorView.d.ts",
73     "api/@internal/component/ets/option.d.ts",
74     "api/@internal/component/ets/pageTransition.d.ts",
75     "api/@internal/component/ets/panel.d.ts",
76     "api/@internal/component/ets/path.d.ts",
77     "api/@internal/component/ets/piece.d.ts",
78     "api/@internal/component/ets/polygon.d.ts",
79     "api/@internal/component/ets/polyline.d.ts",
80     "api/@internal/component/ets/progress.d.ts",
81     "api/@internal/component/ets/qrcode.d.ts",
82     "api/@internal/component/ets/radio.d.ts",
83     "api/@internal/component/ets/rating.d.ts",
84     "api/@internal/component/ets/rect.d.ts",
85     "api/@internal/component/ets/row.d.ts",
86     "api/@internal/component/ets/row_split.d.ts",
87     "api/@internal/component/ets/scroll.d.ts",
88     "api/@internal/component/ets/shape.d.ts",
89     "api/@internal/component/ets/slider.d.ts",
90     "api/@internal/component/ets/span.d.ts",
91     "api/@internal/component/ets/stack.d.ts",
92     "api/@internal/component/ets/stateManagement.d.ts",
93     "api/@internal/component/ets/swiper.d.ts",
94     "api/@internal/component/ets/tab_content.d.ts",
95     "api/@internal/component/ets/tabs.d.ts",
96     "api/@internal/component/ets/text.d.ts",
97     "api/@internal/component/ets/textPicker.d.ts",
98     "api/@internal/component/ets/textarea.d.ts",
99     "api/@internal/component/ets/textinput.d.ts",
100     "api/@internal/component/ets/toggle.d.ts",
101     "api/@internal/component/ets/video.d.ts",
102   ]
103   outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
104   module_source_dir = target_out_dir + "/$target_name"
105   module_install_name = ""
106 }
107 
108 ohos_copy("common_api") {
109   sources = [
110     "api/common/@system.app.d.ts",
111     "api/common/@system.battery.d.ts",
112     "api/common/@system.bluetooth.d.ts",
113     "api/common/@system.brightness.d.ts",
114     "api/common/@system.cipher.d.ts",
115     "api/common/@system.configuration.d.ts",
116     "api/common/@system.device.d.ts",
117     "api/common/@system.fetch.d.ts",
118     "api/common/@system.file.d.ts",
119     "api/common/@system.geolocation.d.ts",
120     "api/common/@system.mediaquery.d.ts",
121     "api/common/@system.network.d.ts",
122     "api/common/@system.notification.d.ts",
123     "api/common/@system.package.d.ts",
124     "api/common/@system.prompt.d.ts",
125     "api/common/@system.request.d.ts",
126     "api/common/@system.router.d.ts",
127     "api/common/@system.sensor.d.ts",
128     "api/common/@system.storage.d.ts",
129     "api/common/@system.vibrator.d.ts",
130   ]
131   outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
132   module_source_dir = target_out_dir + "/$target_name"
133   module_install_name = ""
134 }
135 
136 template("ohos_declaration_template") {
137   forward_variables_from(invoker, "*")
138   action_with_pydeps(target_name) {
139     script = "//interface/sdk-js/remove_internal.py"
140     outputs = [ root_out_dir + "/$target_name/" ]
141     args = [
142       "--input",
143       rebase_path("//interface/sdk-js/api", root_build_dir),
144       "--output",
145       rebase_path(root_out_dir + "/ohos_declaration/$target_name/",
146                   root_build_dir),
147     ]
148   }
149   _module_info_target = "/ohos_declaration/${target_name}_info"
150   _target_name = target_name
151   generate_module_info(_module_info_target) {
152     module_type = "jsdoc"
153     module_install_name = ""
154     module_name = _target_name
155     module_source_dir = root_out_dir + "/ohos_declaration/$_target_name"
156     install_enable = false
157   }
158 }
159 
160 ohos_declaration_template("ohos_declaration_ets") {
161 }
162 ohos_declaration_template("ohos_declaration_phone") {
163 }
164 
165 ohos_copy("ace_platform") {
166   sources = [
167     "api/config",
168     "api/phone",
169   ]
170   outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
171   module_source_dir = target_out_dir + "/$target_name"
172   module_install_name = ""
173 }
174 
175 ohos_copy("form_declaration") {
176   sources = [
177     "api/form/action",
178     "api/form/css",
179     "api/form/hml",
180   ]
181   outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
182   module_source_dir = target_out_dir + "/$target_name"
183   module_install_name = ""
184 }
185