From d60a0786633392c240ee5b269e95a8bc5613c47c Mon Sep 17 00:00:00 2001 From: chuxuezhe111 Date: Wed, 29 Jun 2022 00:55:29 -0700 Subject: [PATCH] add the relative_path argument to adapter the root_build_dir Signed-off-by: chuxuezhe111 --- build_ts_js.py | 6 ++++-- convertxml/BUILD.gn | 2 ++ uri/BUILD.gn | 2 ++ url/BUILD.gn | 2 ++ xml/BUILD.gn | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/build_ts_js.py b/build_ts_js.py index 79c672f..aab71a3 100755 --- a/build_ts_js.py +++ b/build_ts_js.py @@ -37,9 +37,11 @@ if __name__ == '__main__': help='the module path') PARSER_INST.add_argument('--out-file', help='js output file') + PARSER_INST.add_argument('--relative-path', + help='the code root path relative the root_build_dir') INPUT_ARGUMENTS = PARSER_INST.parse_args() - BUILD_PATH = os.path.abspath(os.path.join(os.getcwd(), "../..")) + BUILD_PATH = os.path.abspath(os.path.join(os.getcwd(), INPUT_ARGUMENTS.relative_path)) os.chdir(("%s" + INPUT_ARGUMENTS.module_path) % BUILD_PATH) NODE_PATH = '../../../../prebuilts/build-tools/common/nodejs/\ node-v12.18.4-linux-x64/bin/node' @@ -55,4 +57,4 @@ typescript/bin/tsc' CMD_INST = shutil.rmtree('./out') - exit(0) \ No newline at end of file + exit(0) diff --git a/convertxml/BUILD.gn b/convertxml/BUILD.gn index 1502d06..30dab6c 100755 --- a/convertxml/BUILD.gn +++ b/convertxml/BUILD.gn @@ -26,6 +26,8 @@ action("build_ts_js") { rebase_path("/base/compileruntime/js_api_module/convertxml"), "--out-file", rebase_path("./out/js_convertxml.js"), + "--relative-path", + rebase_path("//", root_build_dir), ] depfile = "$target_gen_dir/$target_name.d" outputs = [ target_out_dir + "/js_convertxml.js" ] diff --git a/uri/BUILD.gn b/uri/BUILD.gn index 3f86443..134e84f 100755 --- a/uri/BUILD.gn +++ b/uri/BUILD.gn @@ -25,6 +25,8 @@ action("build_ts_js") { rebase_path("/base/compileruntime/js_api_module/uri"), "--out-file", rebase_path("./out/js_uri.js"), + "--relative-path", + rebase_path("//", root_build_dir), ] depfile = "$target_gen_dir/$target_name.d" outputs = [ target_out_dir + "/js_uri.js" ] diff --git a/url/BUILD.gn b/url/BUILD.gn index 684a544..97f07bb 100755 --- a/url/BUILD.gn +++ b/url/BUILD.gn @@ -25,6 +25,8 @@ action("build_ts_js") { rebase_path("/base/compileruntime/js_api_module/url"), "--out-file", rebase_path("./out/js_url.js"), + "--relative-path", + rebase_path("//", root_build_dir), ] depfile = "$target_gen_dir/$target_name.d" outputs = [ target_out_dir + "/js_url.js" ] diff --git a/xml/BUILD.gn b/xml/BUILD.gn index fc64d54..dd213ee 100644 --- a/xml/BUILD.gn +++ b/xml/BUILD.gn @@ -27,6 +27,8 @@ action("build_ts_js") { rebase_path("/base/compileruntime/js_api_module/xml"), "--out-file", rebase_path("./out/js_xml.js"), + "--relative-path", + rebase_path("//", root_build_dir), ] depfile = "$target_gen_dir/$target_name.d" outputs = [ target_out_dir + "/js_xml.js" ]