!611 support gn build for third/parse5.

Merge pull request !611 from lihong/opensource
This commit is contained in:
openharmony_ci 2023-12-22 13:19:17 +00:00 committed by Gitee
commit 5eff666c06
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 3 additions and 30 deletions

View File

@ -27,8 +27,6 @@ action("build_ace_loader_library") {
_module_source_js = _ace_loader_dir + "/module-source.js"
_parse5_project_dir = "//third_party/parse5/packages/parse5"
if (is_standard_system) {
_ace_config_dir = "ace-loader"
} else {
@ -37,12 +35,10 @@ action("build_ace_loader_library") {
_babel_js = _ace_config_dir + "/node_modules/@babel/cli/bin/babel.js"
_babel_config_js = _ace_config_dir + "/babel.config.js"
_uglify_source_js = _ace_config_dir + "/uglify-source.js"
_tsc_js = _parse5_project_dir + "/node_modules/typescript/bin/tsc"
inputs = [
_babel_config_js,
_babel_js,
_tsc_js,
_module_source_js,
_uglify_source_js,
]
@ -60,12 +56,6 @@ action("build_ace_loader_library") {
rebase_path(_ace_loader_dir + "/src", root_build_dir),
"--babel-config-js",
rebase_path(_babel_config_js, root_build_dir),
"--tsc-js",
rebase_path(_tsc_js, root_build_dir),
"--parse5-project",
rebase_path(_parse5_project_dir, root_build_dir),
"--parse5-output-dir",
rebase_path(_parse5_project_dir + "/dist/cjs", root_build_dir),
"--module-source-js",
rebase_path(_module_source_js, root_build_dir),
"--uglify-source-js",
@ -94,7 +84,6 @@ ohos_copy("ace_loader") {
outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ]
module_source_dir = target_out_dir + "/$target_name/"
module_install_name = ""
license_file = "//third_party/parse5/LICENSE"
}
ohos_copy("ace_loader_library") {
@ -103,7 +92,6 @@ ohos_copy("ace_loader_library") {
outputs = [ target_out_dir + "/$target_name" ]
module_source_dir = target_out_dir + "/$target_name"
module_install_name = ""
license_file = "//third_party/weex-loader/NOTICE"
}
# copy previewer
@ -139,5 +127,4 @@ ohos_copy("ace_loader_ark_hap") {
]
sources = [ ace_loader_lib_dir ]
outputs = [ ace_loader_ark_dir + "/lib" ]
license_file = "//third_party/parse5/LICENSE"
}

View File

@ -70,4 +70,3 @@ copyResource(path.resolve(__dirname, './plugin/theme'), process.argv[2] + '/them
copyResource(path.resolve(__dirname, './plugin/codegen'), process.argv[2] + '/codegen');
copyResource(path.resolve(__dirname, './third_party/weex-loader/deps/weex-scripter'), process.argv[2] + '/scripter');
copyResource(path.resolve(__dirname, './third_party/weex-loader/deps/weex-styler'), process.argv[2] + '/styler');
copyResource(path.resolve(__dirname, './third_party/parse5/packages/parse5/dist/cjs'), process.argv[2] + '/parse');

View File

@ -40,9 +40,6 @@ def parse_args():
parser.add_argument('--babel-js', help='path to babel.js')
parser.add_argument('--ace-loader-src-dir', help='path to ace-loader/src')
parser.add_argument('--babel-config-js', help='path babel.config.js')
parser.add_argument('--tsc-js', help='path to parse5 module tsc')
parser.add_argument('--parse5-project', help='path to parse5 project')
parser.add_argument('--parse5-output-dir', help='path to parse5 output')
parser.add_argument('--module-source-js', help='path module-source.js')
parser.add_argument('--uglify-source-js', help='path uglify-source.js')
parser.add_argument('--output-dir', help='path to output')
@ -51,8 +48,8 @@ def parse_args():
return options
def do_build(build_cmd, buildparse5_cmd, copy_cmd, uglify_cmd):
for cmd in [build_cmd, buildparse5_cmd, copy_cmd, uglify_cmd]:
def do_build(build_cmd, copy_cmd, uglify_cmd):
for cmd in [build_cmd, copy_cmd, uglify_cmd]:
build_utils.check_output(cmd)
@ -66,16 +63,6 @@ def main():
depfile_deps = [options.node, options.babel_js, options.babel_config_js]
depfile_deps.extend(build_utils.get_all_files(options.ace_loader_src_dir))
buildparse5_cmd = [
options.node, options.tsc_js
]
buildparse5_cmd.extend(['--project', options.parse5_project])
buildparse5_cmd.extend(['--outDir', options.parse5_output_dir])
buildparse5_cmd.extend(['--module', 'CommonJS'])
buildparse5_cmd.extend(['--target', 'ES6'])
depfile_deps.append(options.tsc_js)
depfile_deps.extend(build_utils.get_all_files(options.parse5_project))
copy_cmd = [options.node, options.module_source_js, options.output_dir]
depfile_deps.append(options.module_source_js)
@ -83,7 +70,7 @@ def main():
depfile_deps.append(options.uglify_source_js)
build_utils.call_and_write_depfile_if_stale(
lambda: do_build(build_cmd, buildparse5_cmd, copy_cmd, uglify_cmd),
lambda: do_build(build_cmd, copy_cmd, uglify_cmd),
options,
depfile_deps=depfile_deps,
input_paths=depfile_deps,