• 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("//build/ohos/notice/notice.gni")
16import("//build/ohos_var.gni")
17import("//build/templates/metadata/module_info.gni")
18import("interface_config.gni")
19
20template("ohos_copy_internal") {
21  forward_variables_from(invoker, "*")
22  iv_input = invoker.iv_input
23  ohos_copy(target_name) {
24    process_script = "//interface/sdk-js/process_internal.py"
25    process_arguments = [
26      "--input",
27      rebase_path(iv_input, root_build_dir),
28      "--remove",
29      rebase_path("//interface/sdk-js/remove_list.json", root_build_dir),
30      "--ispublic",
31      "${sdk_build_public}",
32      "--name",
33      "$target_name",
34    ]
35    sources = exec_script(process_script, process_arguments, "value")
36    outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
37    module_source_dir = target_out_dir + "/$target_name"
38    module_install_name = ""
39  }
40}
41
42ohos_copy_internal("ets_internal_api") {
43  iv_input = "//interface/sdk-js/api/@internal/ets"
44}
45
46ohos_copy_internal("ets_component") {
47  iv_input = "//interface/sdk-js/api/@internal/component/ets"
48}
49
50ohos_copy("common_api") {
51  sources = common_api_src
52  outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
53  module_source_dir = target_out_dir + "/$target_name"
54  module_install_name = ""
55}
56
57if (!sdk_build_public) {
58  ohos_copy("bundle_api") {
59    sources = [ "api/bundle/bundleStatusCallback.d.ts" ]
60    outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
61    module_source_dir = target_out_dir + "/$target_name"
62    module_install_name = ""
63  }
64}
65
66template("ohos_declaration_template") {
67  forward_variables_from(invoker, "*")
68  action_with_pydeps(target_name) {
69    script = "//interface/sdk-js/remove_internal.py"
70    input_api_dir = "//interface/sdk-js/api"
71    outputs = [ root_out_dir + "/ohos_declaration/$target_name" ]
72    if (sdk_build_public || product_name == "ohos-sdk") {
73      script = "//out/sdk-public/public_interface/sdk-js/remove_internal.py"
74      input_api_dir = "//out/sdk-public/public_interface/sdk-js/api"
75    }
76    args = [
77      "--input",
78      rebase_path(input_api_dir, root_build_dir),
79      "--output",
80      rebase_path(root_out_dir + "/ohos_declaration/$target_name/",
81                  root_build_dir),
82    ]
83  }
84  _module_info_target = "/ohos_declaration/${target_name}_info"
85  _target_name = target_name
86  generate_module_info(_module_info_target) {
87    module_type = "jsdoc"
88    module_install_name = ""
89    module_name = _target_name
90    module_source_dir = root_out_dir + "/ohos_declaration/$_target_name"
91    install_enable = false
92  }
93}
94
95ohos_declaration_template("ohos_declaration_ets") {
96}
97ohos_declaration_template("ohos_declaration_common") {
98}
99
100ohos_copy_internal("internal_full") {
101  iv_input = "//interface/sdk-js/api/common/full"
102}
103
104ohos_copy_internal("internal_lite") {
105  iv_input = "//interface/sdk-js/api/common/lite"
106}
107
108ohos_copy("syscap_check") {
109  sources = [ "api/syscapCheck/sysCapSchema.json" ]
110  outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
111  module_source_dir = target_out_dir + "/$target_name"
112  module_install_name = ""
113}
114
115ohos_copy("config") {
116  sources = [
117    "api/config/css",
118    "api/config/hml",
119  ]
120  outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
121  module_source_dir = target_out_dir + "/$target_name"
122  module_install_name = ""
123}
124
125ohos_copy("form_declaration") {
126  sources = [
127    "api/form/action",
128    "api/form/css",
129    "api/form/hml",
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