add the relative_path argument to adapter the root_build_dir

Signed-off-by: chuxuezhe111 <hanjixiao@huawei.com>
This commit is contained in:
chuxuezhe111
2022-06-29 00:55:29 -07:00
committed by chuxuezhe11
parent b78cc0acfd
commit 2c21aa6086
5 changed files with 12 additions and 2 deletions
+4 -2
View File
@@ -37,9 +37,11 @@ if __name__ == '__main__':
help='the module path') help='the module path')
PARSER_INST.add_argument('--out-file', PARSER_INST.add_argument('--out-file',
help='js output 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() 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) os.chdir(("%s" + INPUT_ARGUMENTS.module_path) % BUILD_PATH)
NODE_PATH = '../../../../prebuilts/build-tools/common/nodejs/\ NODE_PATH = '../../../../prebuilts/build-tools/common/nodejs/\
node-v12.18.4-linux-x64/bin/node' node-v12.18.4-linux-x64/bin/node'
@@ -55,4 +57,4 @@ typescript/bin/tsc'
CMD_INST = shutil.rmtree('./out') CMD_INST = shutil.rmtree('./out')
exit(0) exit(0)
+2
View File
@@ -26,6 +26,8 @@ action("build_ts_js") {
rebase_path("/base/compileruntime/js_api_module/convertxml"), rebase_path("/base/compileruntime/js_api_module/convertxml"),
"--out-file", "--out-file",
rebase_path("./out/js_convertxml.js"), rebase_path("./out/js_convertxml.js"),
"--relative-path",
rebase_path("//", root_build_dir),
] ]
depfile = "$target_gen_dir/$target_name.d" depfile = "$target_gen_dir/$target_name.d"
outputs = [ target_out_dir + "/js_convertxml.js" ] outputs = [ target_out_dir + "/js_convertxml.js" ]
+2
View File
@@ -25,6 +25,8 @@ action("build_ts_js") {
rebase_path("/base/compileruntime/js_api_module/uri"), rebase_path("/base/compileruntime/js_api_module/uri"),
"--out-file", "--out-file",
rebase_path("./out/js_uri.js"), rebase_path("./out/js_uri.js"),
"--relative-path",
rebase_path("//", root_build_dir),
] ]
depfile = "$target_gen_dir/$target_name.d" depfile = "$target_gen_dir/$target_name.d"
outputs = [ target_out_dir + "/js_uri.js" ] outputs = [ target_out_dir + "/js_uri.js" ]
+2
View File
@@ -25,6 +25,8 @@ action("build_ts_js") {
rebase_path("/base/compileruntime/js_api_module/url"), rebase_path("/base/compileruntime/js_api_module/url"),
"--out-file", "--out-file",
rebase_path("./out/js_url.js"), rebase_path("./out/js_url.js"),
"--relative-path",
rebase_path("//", root_build_dir),
] ]
depfile = "$target_gen_dir/$target_name.d" depfile = "$target_gen_dir/$target_name.d"
outputs = [ target_out_dir + "/js_url.js" ] outputs = [ target_out_dir + "/js_url.js" ]
+2
View File
@@ -27,6 +27,8 @@ action("build_ts_js") {
rebase_path("/base/compileruntime/js_api_module/xml"), rebase_path("/base/compileruntime/js_api_module/xml"),
"--out-file", "--out-file",
rebase_path("./out/js_xml.js"), rebase_path("./out/js_xml.js"),
"--relative-path",
rebase_path("//", root_build_dir),
] ]
depfile = "$target_gen_dir/$target_name.d" depfile = "$target_gen_dir/$target_name.d"
outputs = [ target_out_dir + "/js_xml.js" ] outputs = [ target_out_dir + "/js_xml.js" ]