一.工具准备要求
Requirements
- Python 2
- Docker (*only required for building using Docker) 单独下载安装
Build
- clone the source code from the J2V8 GitHub repository
- run
j2v8-cli.cmd
(on Win32) orsource j2v8-cli.sh
on MacOS / Linux -
nodejs git clone
to clone the Node.js/V8 source code -
nodejs diff apply
to apply the required modifications to the Node.js source code - start the desired J2V8 build either via
build -i
orbuild ...args
(see below for details)
使用文档
https://eclipsesource.com/blogs/tutorials/getting-started-with-j2v8/
二.代码下载
github代码
https://github.com/eclipsesource/J2V8
三.代码编译
编译文档
https://github.com/eclipsesource/J2V8/blob/master/BUILDING.md
编译工具docker安装说明
https://docs.docker.com/install/linux/linux-postinstall/
交叉编译:
If no build-steps are specified, then the CLI will run all available build-steps by default. To see a list of available build-steps run build --help or see the Build-Steps section below.
For ease of use, there are also some advanced build-step aliases that when specified will run a collection of some of the base-steps:
all ... is the default, and will run all known build-steps
native ... will run only the build-steps that are relevant for building native artifacts
node_js, j2v8_cmake, j2v8_jni, j2v8_cpp, j2v8_optimize
j2v8 ... runs all build-steps, except for nodejs and j2v8test
java ... alias for the single j2v8java step
test ... alias for the single j2v8test step
默认全部编译
python2 build.py -t android -a arm64 -dkr
完整编译命令
python ./build.py --cross-agent docker -t android -a arm64 nodejs j2v8cmake j2v8jni j2v8cpp j2v8optimize j2v8java j2v8test