mirror of
https://github.com/openharmony/ark_ts2abc.git
synced 2026-07-01 09:24:57 -04:00
Revise readme & config
Signed-off-by: hufeng <hufeng20@huawei.com> Change-Id: I4094e5b2cd00d0139a57ba00cab27666fe8f55d2
This commit is contained in:
@@ -34,7 +34,7 @@ For more information, see: [ARK Runtime Subsystem](https://gitee.com/openharmony
|
||||
ts2abc uses the command line interaction mode and converts JS code into ARK bytecode files that can be run on an ARK runtime system. ts2abc supports Windows, Linux, and macOS. Front-end tools, converting JS source code into ARK bytecode, can be built by specifying the `--build-target` with `ark_ts2abc` on Linux.
|
||||
|
||||
```
|
||||
$ ./build.sh --product-name Hi3516DV300 --build-target ark_ts2abc_build
|
||||
$ ./build.sh --product-name hispark_taurus_standard --build-target ark_ts2abc_build
|
||||
```
|
||||
|
||||
### Usage Guidelines<a name="section33105542504"></a>
|
||||
@@ -44,7 +44,7 @@ Install `node` and `npm`
|
||||
convert JS to ARK bytecode
|
||||
|
||||
```
|
||||
$ cd out//hi3516dv300/clang_x64/ark/ark/build
|
||||
$ cd out/hispark_taurus/clang_x64/ark/ark/build
|
||||
$ npm install
|
||||
$ node --expose-gc src/index.js [options] file.js
|
||||
```
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@ ts2abc组件是方舟运行时子系统的前端工具,支持将JavaScript文
|
||||
ts2abc组件采用命令行交互方式,支持将JavaScript代码转换为方舟字节码文件,使其能够在方舟运行时上运行。支持Windows/Linux/MacOS平台。方舟前端工具在linux平台上可通过全量编译或指定编译前端工具链获取。
|
||||
|
||||
```
|
||||
$ ./build.sh --product-name Hi3516DV300 --build-target ark_ts2abc_build
|
||||
$ ./build.sh --product-name hispark_taurus_standard --build-target ark_ts2abc_build
|
||||
```
|
||||
|
||||
### 使用说明<a name="section33105542504"></a>
|
||||
@@ -44,7 +44,7 @@ $ ./build.sh --product-name Hi3516DV300 --build-target ark_ts2abc_build
|
||||
使用ts2abc组件将JavaScript文件转换为方舟字节码文件
|
||||
|
||||
```
|
||||
$ cd out/hi3516dv300/clang_x64/ark/ark/build
|
||||
$ cd out/hispark_taurus/clang_x64/ark/ark/build
|
||||
$ npm install
|
||||
$ node --expose-gc src/index.js [options] file.js
|
||||
```
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ intl_skip_tests.json: This file contains a list of non-compliant internationaliz
|
||||
|
||||
## 1. Compile ts2abc and ark_js_vm project
|
||||
```
|
||||
./build.sh --product-name Hi3516DV300 --build-target ark_js_vm --build-target ark_ts2abc_build
|
||||
./build.sh --product-name hispark_taurus_standard --build-target ark_js_vm --build-target ark_ts2abc_build
|
||||
```
|
||||
|
||||
## 2 Run test cases
|
||||
|
||||
+3
-3
@@ -30,10 +30,10 @@ BASE_OUT_DIR = os.path.join("out", "test262")
|
||||
|
||||
CUR_FILE_DIR = os.path.dirname(__file__)
|
||||
CODE_ROOT = os.path.abspath(os.path.join(CUR_FILE_DIR, "../../.."))
|
||||
ARK_DIR = f"{CODE_ROOT}/out/hi3516dv300/clang_x64/ark/ark"
|
||||
ICUI_DIR = f"{CODE_ROOT}/out/hi3516dv300/clang_x64/global/i18n_standard"
|
||||
ARK_DIR = f"{CODE_ROOT}/out/hispark_taurus/clang_x64/ark/ark"
|
||||
ICUI_DIR = f"{CODE_ROOT}/out/hispark_taurus/clang_x64/thirdparty/icu"
|
||||
LLVM_DIR = f"{CODE_ROOT}/prebuilts/clang/ohos/linux-x86_64/llvm/lib/"
|
||||
ARK_JS_RUNTIME_DIR = f"{CODE_ROOT}/out/hi3516dv300/clang_x64/ark/ark_js_runtime"
|
||||
ARK_JS_RUNTIME_DIR = f"{CODE_ROOT}/out/hispark_taurus/clang_x64/ark/ark_js_runtime"
|
||||
|
||||
DEFAULT_MODE = 2
|
||||
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@
|
||||
2. import_tests.json:Is the path to the TS code file where import files are stored to add import files.
|
||||
|
||||
### Environment to prepare
|
||||
1. Compile TS2ABC warehouse in hongmeng system code root directory. Delete the out directory and run the './build.sh --product-name Hi3516DV300 --build-target ark_ts2abc' command.
|
||||
2. Go to the tool build directory 'cd out/hi3516DV300/clang_x64/ark/ark/build' in the out file and run the 'npm install' command to set up the environment
|
||||
1. Compile TS2ABC warehouse in hongmeng system code root directory. Delete the out directory and run the './build.sh --product-name hispark_taurus_standard --build-target ark_ts2abc' command.
|
||||
2. Go to the tool build directory 'cd out/hispark_taurus/clang_x64/ark/ark/build' in the out file and run the 'npm install' command to set up the environment
|
||||
3. After setting up the environment, enter the ark/ts2abc directory of Hongmeng system
|
||||
|
||||
### Execute test framework
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@
|
||||
2.import_tests.json:存放import的ts代码文件路径,对import类型文件进行添加。<br>
|
||||
|
||||
### 环境准备
|
||||
1.在鸿蒙系统代码根目录下编译ts2abc仓。先删除out目录,然后执行./build.sh --product-name Hi3516DV300 --build-target ark_ts2abc命令进行编译。<br>
|
||||
2.进入out文件中的工具build目录 cd out/hi3516dv300/clang_x64/ark/ark/build,使用npm install命令进行环境搭建<br>
|
||||
1.在鸿蒙系统代码根目录下编译ts2abc仓。先删除out目录,然后执行./build.sh --product-name hispark_taurus_standard --build-target ark_ts2abc命令进行编译。<br>
|
||||
2.进入out文件中的工具build目录 cd out/hispark_taurus/clang_x64/ark/ark/build,使用npm install命令进行环境搭建<br>
|
||||
3.搭建完环境,进入到鸿蒙系统ark/ts2abc目录下<br>
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ SKIP_FILE_PATH = os.path.join("testTs", "skip_tests.json")
|
||||
IMPORT_FILE_PATH = os.path.join("testTs", "import_tests.json")
|
||||
CUR_FILE_DIR = os.path.dirname(__file__)
|
||||
CODE_ROOT = os.path.abspath(os.path.join(CUR_FILE_DIR, "../../.."))
|
||||
ARK_DIR = f"{CODE_ROOT}/out/hi3516dv300/clang_x64/ark/ark"
|
||||
ARK_DIR = f"{CODE_ROOT}/out/hispark_taurus/clang_x64/ark/ark"
|
||||
WORK_PATH = f'{CODE_ROOT}/ark/ts2abc'
|
||||
|
||||
DEFAULT_ARK_FRONTEND_TOOL = os.path.join(ARK_DIR, "build", "src", "index.js")
|
||||
|
||||
@@ -27,7 +27,7 @@ CUR_FILE_DIR = os.path.dirname(__file__)
|
||||
TS2PANDA_DIR = os.path.abspath(os.path.join(CUR_FILE_DIR, ".."))
|
||||
CODE_ROOT = os.path.abspath(os.path.join(TS2PANDA_DIR, "../../.."))
|
||||
DEFAULT_TARGET_DIR = os.path.join(
|
||||
CODE_ROOT, "out/hi3516dv300/clang_x64/obj/ark/ts2abc/ts2panda")
|
||||
CODE_ROOT, "out/hispark_taurus/clang_x64/obj/ark/ts2abc/ts2panda")
|
||||
DEFAULT_NODE_MODULE = os.path.join(
|
||||
CODE_ROOT, "prebuilts/build-tools/common/ts2abc/node_modules")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user