mirror of
https://github.com/openharmony/js_api_module.git
synced 2026-07-01 03:23:21 -04:00
1956f2e85d
Related Issue https://gitee.com/openharmony/manifest/issues/I5HDQT Description Switch component name from ts_js_lang_library to ets_utils for js_api_module,js_util_module,js_sys_module,js_worker_module Signed-off-by: lengchangjing <lengchangjing@huawei.com>
121 lines
3.4 KiB
Plaintext
121 lines
3.4 KiB
Plaintext
# Copyright (c) 2021 Huawei Device Co., Ltd.
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
import("//arkcompiler/ets_frontend/ts2panda/ts2abc_config.gni")
|
|
import("//build/ohos.gni")
|
|
import("//build/ohos/ace/ace.gni")
|
|
import("//foundation/arkui/ace_engine/ace_config.gni")
|
|
|
|
# compile .ts to .js.
|
|
action("build_ts_js") {
|
|
script = "//commonlibrary/ets_utils/js_util_module/build_ts_js.py"
|
|
args = [
|
|
"--dst-file",
|
|
rebase_path(target_out_dir + "/util_js.js"),
|
|
"--module-path",
|
|
rebase_path("/commonlibrary/ets_utils/js_util_module/util"),
|
|
"--out-file",
|
|
rebase_path("./out/util_js.js"),
|
|
"--relative-path",
|
|
rebase_path("//", root_build_dir),
|
|
]
|
|
depfile = "$target_gen_dir/$target_name.d"
|
|
outputs = [ target_out_dir + "/util_js.js" ]
|
|
}
|
|
base_output_path = get_label_info(":util_js", "target_out_dir")
|
|
util_js_obj_path = base_output_path + "/util.o"
|
|
gen_js_obj("util_js") {
|
|
input = "$target_out_dir/util_js.js"
|
|
output = util_js_obj_path
|
|
dep = ":build_ts_js"
|
|
}
|
|
|
|
# compile .js to .abc.
|
|
action("gen_util_abc") {
|
|
visibility = [ ":*" ]
|
|
script = "//arkcompiler/ets_frontend/ts2panda/scripts/generate_js_bytecode.py"
|
|
|
|
args = [
|
|
"--src-js",
|
|
rebase_path(target_out_dir + "/util_js.js"),
|
|
"--dst-file",
|
|
rebase_path(target_out_dir + "/util.abc"),
|
|
"--node",
|
|
rebase_path("${node_path}"),
|
|
"--frontend-tool-path",
|
|
rebase_path("${ts2abc_build_path}"),
|
|
"--node-modules",
|
|
rebase_path("${node_modules}"),
|
|
"--module",
|
|
]
|
|
deps = [
|
|
":build_ts_js",
|
|
"//arkcompiler/ets_frontend/ts2panda:ark_ts2abc_build",
|
|
]
|
|
|
|
inputs = [ target_out_dir + "/util_js.js" ]
|
|
outputs = [ target_out_dir + "/util.abc" ]
|
|
}
|
|
|
|
abc_output_path = get_label_info(":util_abc", "target_out_dir")
|
|
util_abc_obj_path = abc_output_path + "/util_abc.o"
|
|
gen_js_obj("util_abc") {
|
|
input = "$target_out_dir/util.abc"
|
|
output = util_abc_obj_path
|
|
dep = ":gen_util_abc"
|
|
}
|
|
|
|
ohos_shared_library("util") {
|
|
include_dirs = [
|
|
"//foundation/arkui/napi",
|
|
"//foundation/arkui/napi/native_engine",
|
|
"//third_party/icu/icu4c/source/common",
|
|
"//third_party/icu/icu4c/source",
|
|
"//third_party/node/src",
|
|
"//foundation/arkui/napi/interfaces/kits",
|
|
"//commonlibrary/ets_utils/js_util_module/util",
|
|
]
|
|
|
|
sources = [
|
|
"js_base64.cpp",
|
|
"js_textdecoder.cpp",
|
|
"js_textencoder.cpp",
|
|
"js_types.cpp",
|
|
"native_module_util.cpp",
|
|
]
|
|
|
|
deps = [
|
|
":util_abc",
|
|
":util_js",
|
|
"//commonlibrary/ets_utils/js_util_module/util/:util_js",
|
|
"//foundation/arkui/napi/:ace_napi",
|
|
"//foundation/arkui/napi/:ace_napi_quickjs",
|
|
"//third_party/icu/icu4c:static_icuuc",
|
|
"//utils/native/base:utils",
|
|
]
|
|
|
|
if (is_standard_system) {
|
|
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
|
|
} else {
|
|
external_deps = [ "hilog:libhilog" ]
|
|
}
|
|
subsystem_name = "commonlibrary"
|
|
part_name = "ets_utils"
|
|
|
|
relative_install_dir = "module"
|
|
}
|
|
|
|
group("util_packages") {
|
|
deps = [ ":util" ]
|
|
}
|