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/config/components/ets_frontend/ets2abc_config.gni") 16 17npm_path = "//prebuilts/build-tools/common/nodejs/current/bin/npm" 18 19action("gen_sdk_ts_wrapper") { 20 script = "build_ts_wrapper.py" 21 deps = [ "./native:es2panda" ] 22 args = [ 23 "--source_path", 24 rebase_path(get_path_info(".", "abspath")), 25 "--output_path", 26 rebase_path("$target_gen_dir"), 27 "--npm", 28 rebase_path(npm_path), 29 "--current_os", 30 "$current_os", 31 "--root_out_dir", 32 rebase_path(root_out_dir), 33 ] 34 35 outputs = [ "$target_gen_dir" ] 36} 37 38ohos_copy("ets2panda_koala_wrapper") { 39 deps = [ ":gen_sdk_ts_wrapper" ] 40 sources = [ rebase_path("$target_gen_dir") ] 41 outputs = [ target_out_dir + "/$target_name" ] 42 module_source_dir = target_out_dir + "/$target_name" 43 module_install_name = "" 44 subsystem_name = "developtools" 45 part_name = "ace_ets2bundle" 46} 47 48ohos_copy("ohos_ets_koala_wrapper") { 49 deps = [ ":gen_sdk_ts_wrapper" ] 50 sources = [ rebase_path("$target_gen_dir") ] 51 outputs = [ ohos_ets_koala_wrapper_path ] 52 subsystem_name = "developtools" 53 part_name = "ace_ets2bundle" 54}