From 64fec855f7b3475b8827faae048e30593d499489 Mon Sep 17 00:00:00 2001 From: kangchongtao Date: Thu, 22 May 2025 15:48:25 +0800 Subject: [PATCH] =?UTF-8?q?jsframework=20=E7=8B=AC=E7=AB=8B=E7=BC=96?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: kangchongtao Change-Id: I0366f669c5dfe14b7c5a28f669efa9725842f41f --- BUILD.gn | 17 +++++++++++++---- bundle.json | 4 +++- js_framework_build.sh | 8 ++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 620ec4c0..852d27a2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -12,7 +12,6 @@ # limitations under the License. import("//build/ohos.gni") -import("//foundation/arkui/ace_engine/ace_config.gni") prebuilt_js_path = get_label_info(":gen_snapshot", "target_out_dir") + "/dist/strip.native.min.js" @@ -28,7 +27,6 @@ action("gen_node_modules") { } action("gen_snapshot") { - deps = [ "//third_party/css-what:css_what_sources" ] script = "//third_party/jsframework/js_framework_build.sh" js_framework = "//third_party/jsframework/runtime" @@ -50,7 +48,16 @@ action("gen_snapshot") { eslint = "//third_party/jsframework/.eslintrc" babel = "//third_party/jsframework/.babelrc" test_file = "//third_party/jsframework/test" - css_what = "//third_party/css-what" + css_what = "" + + if (ohos_indep_compiler_enable) { + external_deps = [ "css-what:css_what_sources" ] + css_what = "obj/binarys/third_party/css-what/innerapis/css_what_sources/src" + is_indep_compiler = "true" + } else { + deps = [ "//third_party/css-what:css_what_sources" ] + is_indep_compiler = "false" + } args = [ rebase_path(nodejs_path, root_build_dir), @@ -65,7 +72,8 @@ action("gen_snapshot") { is_mac, rebase_path("//prebuilts", root_build_dir), rebase_path(buildfile_native_min, root_build_dir), - rebase_path(css_what, root_build_dir), + css_what, + is_indep_compiler ] inputs = [ @@ -263,5 +271,6 @@ ohos_prebuilt_etc("ark_build") { source = ark_abc_path if (!is_arkui_x) { part_name = "jsframework" + subsystem_name = "thirdparty" } } diff --git a/bundle.json b/bundle.json index cf195612..e85fba4d 100644 --- a/bundle.json +++ b/bundle.json @@ -20,7 +20,9 @@ "rom": "", "ram": "", "deps": { - "components": [], + "components": [ + "css-what" + ], "third_party": [] }, "build": { diff --git a/js_framework_build.sh b/js_framework_build.sh index 95192d6a..850127c3 100755 --- a/js_framework_build.sh +++ b/js_framework_build.sh @@ -18,6 +18,10 @@ prebuilts_path=${11} # copy dependency file to generate dir of gn # the params come from .gn +if [ "${14}" == 'true' ];then + rm -rf $2/src +fi + # copy runtime to target out, and runtime/css-what is solt link, copy it always follow symbolic links in SOURCE if [ "${10}" == 'true' ];then cp -R -L $2 $8 @@ -25,6 +29,10 @@ else cp -r -L $2 $8 fi +if [ "${14}" == 'true' ];then + cp -r -L ${13} obj/third_party/jsframework/runtime +fi + # $2 => node $4 => node_modules cp -f $4 $8