Ruff is a JavaScript runtime built for hardware development.
- Node.js 6
- CMake 2.8
- Install required modules
git submodule update --init --recursive
# Install npm dependencies
npm install
# Install rap dependencies
rap install
Please see procedures
field in dist.config.js
and find related gulp tasks.
E.g., clean
, generate-*
, build-*
and prepare-modules
.
Run all tests:
npm run test # or `gulp test-modules`
Generate coverage report:
npm run report
# Desktop
npm run dist
# Embedded (see note below)
npm run dist-embedded
Due to libuv build tool gyp limitation on Mac OS, ruff can only built on Linux platform using Android NDK toolchain.
NDK toolchains support armv7/armv8/i386/amd64/mips/mips64
ISAs. Theoretically speaking, we can built binary ruff with them, but now we just support armv7.
Before build, you need export these following two environment variables RUFF_CAMKE_CC
and ANDROID_NDK_HOME
.
Example (on ruff-node machine):
$ export RUFF_CMAKE_CC=/data/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-gcc
$ export ANDROID_NDK_HOME=/data/android-ndk-r10e
$ ./build.sh
You can get armv7 binary ruff under build/ruff/bin directory.
Q: How to generate standlaone toolchain directory like
/data/arm-linux-android-4.9
?A: Use NDK tool make-standalone-toolchain.sh script, refer to the following example.
$ ./android-ndk-r10e/build/tools/make-standalone-toolchain.sh --toolchain=arm-linux-androideabi-4.9 --arch=arm --install-dir=./arm-linux-androideabi-4.9 --platform=android-21