From 612b6ebf0c14df449ef8184265f2ebe1eeb5543f Mon Sep 17 00:00:00 2001 From: lihong Date: Tue, 19 Dec 2023 15:11:10 +0800 Subject: [PATCH] lihong67@huawei.com support gn build for third/parse5. Signed-off-by: lihong Change-Id: I39af0a8f7e4923b6d27d4e63d6c561c1e1cbd2f1 --- BUILD.gn | 13 ------------- ace-loader/module-source.js | 1 - build_ace_loader_library.py | 19 +++---------------- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 512aedc..63b4ca1 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -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" } diff --git a/ace-loader/module-source.js b/ace-loader/module-source.js index 78d4d4a..bb41edc 100644 --- a/ace-loader/module-source.js +++ b/ace-loader/module-source.js @@ -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'); diff --git a/build_ace_loader_library.py b/build_ace_loader_library.py index 9d07181..785a582 100755 --- a/build_ace_loader_library.py +++ b/build_ace_loader_library.py @@ -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,