# Copyright (c) 2021-2022 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.
import("//build/config/components/ets_frontend/ets2abc_config.gni")
import("//build/ohos.gni")
npm_path = "//prebuilts/build-tools/common/nodejs/current/bin/npm"
action("gen_ui_plugins") {
script = "build_ui_plugins.py"
ui_plugin_source = "//developtools/ace_ets2bundle/arkui-plugins"
inputs = [ ui_plugin_source ]
args = [
"--source_path",
rebase_path(get_path_info(".", "abspath")),
"--output_path",
rebase_path("$target_gen_dir"),
"--npm",
rebase_path(npm_path),
"--current_os",
"$current_os",
"--root_out_dir",
rebase_path(root_out_dir),
]
outputs = [ "$target_gen_dir" ]
}
action("build_ets_sysResource") {
deps = [ ":gen_ui_plugins" ]
script = "//developtools/ace_ets2bundle/generateSysResource.py"
ets_sysResource = "$target_gen_dir" + "/lib/ui-plugins/sysResource.js"
outputs = [ ets_sysResource ]
_id_defined_json = "//base/global/system_resources/systemres/main/resources/base/element/id_defined.json"
inputs = [ _id_defined_json ]
args = [
"--input-json",
rebase_path(_id_defined_json, root_build_dir),
"--output-js",
rebase_path(ets_sysResource, root_build_dir),
]
}
ohos_copy("ui_plugin") {
deps = [
":build_ets_sysResource",
":gen_ui_plugins",
]
sources = [ rebase_path("$target_gen_dir") ]
outputs = [ target_out_dir + "/$target_name" ]
module_source_dir = target_out_dir + "/$target_name"
module_install_name = ""
subsystem_name = "developtools"
part_name = "ace_ets2bundle"
}
ohos_copy("ohos_ets_ui_plugins") {
deps = [
":build_ets_sysResource",
":gen_ui_plugins",
]
sources = [ rebase_path("$target_gen_dir") ]
outputs = [ ohos_ets_ui_plugins_path ]
subsystem_name = "developtools"
part_name = "ace_ets2bundle"
}