diff --git a/BUILD.gn b/BUILD.gn index e1313d198c90a92af6c117b1fa0c2d8633ce60b9..c43dd8acae863e67d767ad37e6d999c28bfb9b87 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -14,6 +14,7 @@ import("//build/ohos.gni") import("//build/ohos/notice/notice.gni") import("//build/templates/metadata/module_info.gni") +import("interface_config.gni") ohos_copy("ets_internal_api") { sources = [ @@ -119,15 +120,7 @@ ohos_copy("ets_component") { } ohos_copy("common_api") { - sources = [ - "api/@ohos.wifi.d.ts", - "api/common/@system.app.d.ts", - "api/common/@system.configuration.d.ts", - "api/common/@system.file.d.ts", - "api/common/@system.mediaquery.d.ts", - "api/common/@system.prompt.d.ts", - "api/common/@system.router.d.ts", - ] + sources = common_api_src outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" module_install_name = "" @@ -144,7 +137,7 @@ template("ohos_declaration_template") { forward_variables_from(invoker, "*") action_with_pydeps(target_name) { script = "//interface/sdk-js/remove_internal.py" - outputs = [ root_out_dir + "/$target_name/" ] + outputs = [ root_out_dir + "/ohos_declaration/$target_name" ] args = [ "--input", rebase_path("//interface/sdk-js/api", root_build_dir), diff --git a/interface_config.gni b/interface_config.gni new file mode 100644 index 0000000000000000000000000000000000000000..f28ccc612921dc831266b9fbe91d6a7181534070 --- /dev/null +++ b/interface_config.gni @@ -0,0 +1,22 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +common_api_src = [ + "//interface/sdk-js/api/@ohos.wifi.d.ts", + "//interface/sdk-js/api/common/@system.app.d.ts", + "//interface/sdk-js/api/common/@system.configuration.d.ts", + "//interface/sdk-js/api/common/@system.file.d.ts", + "//interface/sdk-js/api/common/@system.mediaquery.d.ts", + "//interface/sdk-js/api/common/@system.prompt.d.ts", + "//interface/sdk-js/api/common/@system.router.d.ts", +]