From 7dd0394f29565ee684a5ad5e6a43ec623ef84d3d Mon Sep 17 00:00:00 2001 From: lifansheng Date: Sat, 16 Oct 2021 16:31:48 +0800 Subject: [PATCH 1/2] Signed-off-by: lifansheng On branch master Your branch is up to date with 'origin/master'. --- convertxml/BUILD.gn | 5 +++++ convertxml/build_ts_js.py | 22 ++++++++++++++-------- uri/BUILD.gn | 5 +++++ uri/build_ts_js.py | 22 ++++++++++++++-------- url/BUILD.gn | 5 +++++ url/build_ts_js.py | 22 ++++++++++++++-------- 6 files changed, 57 insertions(+), 24 deletions(-) diff --git a/convertxml/BUILD.gn b/convertxml/BUILD.gn index 5e130653..90787f57 100755 --- a/convertxml/BUILD.gn +++ b/convertxml/BUILD.gn @@ -19,6 +19,11 @@ import("//foundation/ace/ace_engine/ace_config.gni") # compile .ts to .js. action("build_ts_js") { script = "//base/compileruntime/js_api_module/convertxml/build_ts_js.py" + + args = [ + "--dst-file", + rebase_path(target_out_dir + "/js_convertxml.js"), + ] depfile = "$target_gen_dir/$target_name.d" outputs = [ target_out_dir + "/js_convertxml.js" ] } diff --git a/convertxml/build_ts_js.py b/convertxml/build_ts_js.py index 83a660e1..e15c15ea 100755 --- a/convertxml/build_ts_js.py +++ b/convertxml/build_ts_js.py @@ -13,17 +13,23 @@ # See the License for the specific language governing permissions and # limitations under the License. import os +import platform +import argparse + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--dst-file', + help='the converted target file') + arguments = parser.parse_args() + return arguments + + if __name__ == '__main__': build_path = os.path.abspath(os.path.join(os.getcwd(), "../..")) os.chdir("%s/base/compileruntime/js_api_module/convertxml" % build_path) - os.system('../../../../developtools/ace-ets2bundle/compiler/node_modules/typescript/bin/tsc') - - if os.access("../../../../out/ohos-arm64-release", os.F_OK): - os.system('cp -r ./out/js_convertxml.js ../../../../out/ohos-arm64-release/obj/base/compileruntime/js_api_module/convertxml/js_convertxml.js') - - if os.access("../../../../out/ohos-arm-release", os.F_OK): - os.system('cp -r ./out/js_convertxml.js ../../../../out/ohos-arm-release/obj/base/compileruntime/js_api_module/convertxml/js_convertxml.js') - + input_arguments = parse_args() + os.system('../../../../prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node ../../../../ark/ts2abc/ts2panda/node_modules/typescript/bin/tsc') + os.system('cp -r ./out/js_convertxml.js ' + input_arguments.dst_file); os.system('rm -rf ./out') \ No newline at end of file diff --git a/uri/BUILD.gn b/uri/BUILD.gn index a136c4bf..f110df36 100755 --- a/uri/BUILD.gn +++ b/uri/BUILD.gn @@ -18,6 +18,11 @@ import("//foundation/ace/ace_engine/ace_config.gni") # compile .ts to .js. action("build_ts_js") { script = "//base/compileruntime/js_api_module/uri/build_ts_js.py" + + args = [ + "--dst-file", + rebase_path(target_out_dir + "/js_uri.js"), + ] depfile = "$target_gen_dir/$target_name.d" outputs = [ target_out_dir + "/js_uri.js" ] } diff --git a/uri/build_ts_js.py b/uri/build_ts_js.py index 4461b2bb..a99b687f 100755 --- a/uri/build_ts_js.py +++ b/uri/build_ts_js.py @@ -13,17 +13,23 @@ # See the License for the specific language governing permissions and # limitations under the License. import os +import platform +import argparse + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--dst-file', + help='the converted target file') + arguments = parser.parse_args() + return arguments + + if __name__ == '__main__': build_path = os.path.abspath(os.path.join(os.getcwd(), "../..")) os.chdir("%s/base/compileruntime/js_api_module/uri" % build_path) - os.system('../../../../developtools/ace-ets2bundle/compiler/node_modules/typescript/bin/tsc') - - if os.access("../../../../out/ohos-arm64-release", os.F_OK): - os.system('cp -r ./out/js_uri.js ../../../../out/ohos-arm64-release/obj/base/compileruntime/js_api_module/uri/js_uri.js') - - if os.access("../../../../out/ohos-arm-release", os.F_OK): - os.system('cp -r ./out/js_uri.js ../../../../out/ohos-arm-release/obj/base/compileruntime/js_api_module/uri/js_uri.js') - + input_arguments = parse_args() + os.system('../../../../prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node ../../../../ark/ts2abc/ts2panda/node_modules/typescript/bin/tsc') + os.system('cp -r ./out/js_uri.js ' + input_arguments.dst_file); os.system('rm -rf ./out') \ No newline at end of file diff --git a/url/BUILD.gn b/url/BUILD.gn index 72187427..3107843f 100755 --- a/url/BUILD.gn +++ b/url/BUILD.gn @@ -20,6 +20,11 @@ import("//foundation/ace/ace_engine/ace_config.gni") action("build_ts_js") { script = "//base/compileruntime/js_api_module/url/build_ts_js.py" + + args = [ + "--dst-file", + rebase_path(target_out_dir + "/js_url.js"), + ] depfile = "$target_gen_dir/$target_name.d" outputs = [ target_out_dir + "/js_url.js" ] } diff --git a/url/build_ts_js.py b/url/build_ts_js.py index fb895e01..e0c6aa0b 100755 --- a/url/build_ts_js.py +++ b/url/build_ts_js.py @@ -13,17 +13,23 @@ # See the License for the specific language governing permissions and # limitations under the License. import os +import platform +import argparse + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--dst-file', + help='the converted target file') + arguments = parser.parse_args() + return arguments + + if __name__ == '__main__': build_path = os.path.abspath(os.path.join(os.getcwd(), "../..")) os.chdir("%s/base/compileruntime/js_api_module/url" % build_path) - os.system('../../../../developtools/ace-ets2bundle/compiler/node_modules/typescript/bin/tsc') - - if os.access("../../../../out/ohos-arm64-release", os.F_OK): - os.system('cp -r ./out/js_url.js ../../../../out/ohos-arm64-release/obj/base/compileruntime/js_api_module/url/js_url.js') - - if os.access("../../../../out/ohos-arm-release", os.F_OK): - os.system('cp -r ./out/js_url.js ../../../../out/ohos-arm-release/obj/base/compileruntime/js_api_module/url/js_url.js') - + input_arguments = parse_args() + os.system('../../../../prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node ../../../../ark/ts2abc/ts2panda/node_modules/typescript/bin/tsc') + os.system('cp -r ./out/js_url.js ' + input_arguments.dst_file); os.system('rm -rf ./out') \ No newline at end of file -- Gitee From d2e9ce998bcdc04bc808014a49b1a69c0440b387 Mon Sep 17 00:00:00 2001 From: lifansheng Date: Sat, 16 Oct 2021 17:22:05 +0800 Subject: [PATCH 2/2] Signed-off-by: lifansheng On branch master Your branch is up to date with 'origin/master'. --- convertxml/build_ts_js.py | 21 +++++++++------------ uri/build_ts_js.py | 21 +++++++++------------ url/build_ts_js.py | 21 +++++++++------------ 3 files changed, 27 insertions(+), 36 deletions(-) diff --git a/convertxml/build_ts_js.py b/convertxml/build_ts_js.py index e15c15ea..a5bad68b 100755 --- a/convertxml/build_ts_js.py +++ b/convertxml/build_ts_js.py @@ -16,20 +16,17 @@ import os import platform import argparse -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('--dst-file', - help='the converted target file') - arguments = parser.parse_args() - return arguments - - - if __name__ == '__main__': build_path = os.path.abspath(os.path.join(os.getcwd(), "../..")) os.chdir("%s/base/compileruntime/js_api_module/convertxml" % build_path) - input_arguments = parse_args() - os.system('../../../../prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node ../../../../ark/ts2abc/ts2panda/node_modules/typescript/bin/tsc') - os.system('cp -r ./out/js_convertxml.js ' + input_arguments.dst_file); + + parser = argparse.ArgumentParser() + parser.add_argument('--dst-file', + help='the converted target file') + input_arguments = parser.parse_args() + + os.system('../../../../prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node ' + '../../../../ark/ts2abc/ts2panda/node_modules/typescript/bin/tsc') + os.system('cp -r ./out/js_convertxml.js ' + input_arguments.dst_file) os.system('rm -rf ./out') \ No newline at end of file diff --git a/uri/build_ts_js.py b/uri/build_ts_js.py index a99b687f..6aec6835 100755 --- a/uri/build_ts_js.py +++ b/uri/build_ts_js.py @@ -16,20 +16,17 @@ import os import platform import argparse -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('--dst-file', - help='the converted target file') - arguments = parser.parse_args() - return arguments - - - if __name__ == '__main__': build_path = os.path.abspath(os.path.join(os.getcwd(), "../..")) os.chdir("%s/base/compileruntime/js_api_module/uri" % build_path) - input_arguments = parse_args() - os.system('../../../../prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node ../../../../ark/ts2abc/ts2panda/node_modules/typescript/bin/tsc') - os.system('cp -r ./out/js_uri.js ' + input_arguments.dst_file); + + parser = argparse.ArgumentParser() + parser.add_argument('--dst-file', + help='the converted target file') + input_arguments = parser.parse_args() + + os.system('../../../../prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node ' + '../../../../ark/ts2abc/ts2panda/node_modules/typescript/bin/tsc') + os.system('cp -r ./out/js_uri.js ' + input_arguments.dst_file) os.system('rm -rf ./out') \ No newline at end of file diff --git a/url/build_ts_js.py b/url/build_ts_js.py index e0c6aa0b..5edfb67a 100755 --- a/url/build_ts_js.py +++ b/url/build_ts_js.py @@ -16,20 +16,17 @@ import os import platform import argparse -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('--dst-file', - help='the converted target file') - arguments = parser.parse_args() - return arguments - - - if __name__ == '__main__': build_path = os.path.abspath(os.path.join(os.getcwd(), "../..")) os.chdir("%s/base/compileruntime/js_api_module/url" % build_path) - input_arguments = parse_args() - os.system('../../../../prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node ../../../../ark/ts2abc/ts2panda/node_modules/typescript/bin/tsc') - os.system('cp -r ./out/js_url.js ' + input_arguments.dst_file); + + parser = argparse.ArgumentParser() + parser.add_argument('--dst-file', + help='the converted target file') + input_arguments = parser.parse_args() + + os.system('../../../../prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node ' + '../../../../ark/ts2abc/ts2panda/node_modules/typescript/bin/tsc') + os.system('cp -r ./out/js_url.js ' + input_arguments.dst_file) os.system('rm -rf ./out') \ No newline at end of file -- Gitee