jsc-android-buildscripts docker
334
The aim of this project is to provide maintainable build scripts for the JavaScriptCore JavaScript engine and allow the React Native project to incorporate up-to-date releases of JSC into the framework on Android.
This project is based on facebook/android-jsc but instead of rewriting JSC's build scripts into BUCK files, it relies on CMake build scripts maintained in a GTK branch of WebKit maintained by the WebKitGTK team (great work btw!). Thanks to that, with just a small amount of work we should be able to build not only current but also future releases of JSC. An obvious benefit for everyone using React Native is that this will allow us to update JSC for React Native on Android much more often than before (note that facebook/android-jsc uses JSC version from Nov 2014), which is especially helpful since React Native on iOS uses the built-in copy of JSC that is updated with each major iOS release (see this as a reference).
brew install coreutilsbrew install nodebrew install gradlebrew tap caskroom/versions && brew cask install java8brew cask install android-sdk
sdkmanager --list and install all platforms, tools, cmake, ndk (android images are not needed)$ANDROID_HOME to the correct path (in ~/.bashrc or similar)export ANDROID_NDK=$ANDROID_HOME/ndk-bundleexport PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools/binpackage.json to the desired build configurationnpm run download: downloads all needed sourcesnpm run prep: copies downloaded sources and prepares for compilationnpm run start: builds jsc (this might take some time...)The zipfile containing the android-jsc AAR will be available at /dist.
The library is packaged as a local Maven repository containing AAR files that include the binaries.
JSC library built using this project is distributed over npm: npm/jsc-android. The library is packaged as a local Maven repository containing AAR files that include the binaries. Please refer to the section below in order to learn how your app can consume this format.
Follow steps below in order for your React Native app to use new version of JSC VM on android:
jsc-android to the "dependencies" section in your package.json:dependencies {
+ "jsc-android": "224109.x.x",
then run npm install or yarn (depending which npm client you use) in order for the new dependency to be installed in node_modules
android/build.gradle file to add new local maven repository packaged in the jsc-android package to the search path:allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
+ maven {
+ // Local Maven repo containing AARs with JSC library built for Android
+ url "$rootDir/../node_modules/jsc-android/dist"
+ }
}
}
build.gradle file located in android/app/build.gradle to force app builds to use new version of the JSC library as opposed to the version specified in react-native gradle module as a dependency:}
+configurations.all {
+ resolutionStrategy {
+ force 'org.webkit:android-jsc:r224109'
+ }
+}
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
See Measurements page that contains synthetic perf test results for the most notable versions of JSC we have tried.
Check the list of contributors here. This project is supported by:
Content type
Image
Digest
Size
2.3 GB
Last updated
over 8 years ago
docker pull gengjiawen/jsc-android-buildscripts