react-native-community/jsc-android-buildscripts is one of the open-source repositories TopGit tracks, currently at 1.1k stars, written primarily in JavaScript. Script for building JavaScriptCore for Android (for React Native but not only)
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
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).
Requirements
Homebrew (https://brew.sh/)
GNU coreutils brew install coreutils
Node brew install node
Java 8: brew tap caskroom/versions && brew cask install java8
Android SDK: brew cask install android-sdk
Run sdkmanager --list and install all platforms, tools, buildtool v28.0.3, cmake (android images are not needed)
Set $ANDROID_HOME to the correct path (in ~/.bashrc or similar)
Set export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools/bin
Android NDK r19c: download from NDK Archives
Set export ANDROID_NDK=/path/to/android-ndk-r19c
Make sure you have Ruby (>2.3), Python (>2.7), Git, gperf
Build instructions
Clone this repo
npm run clean will clean everything (artifacts, downloaded sources)
Update the version in package.json. The version will be printed by JSC lib as soon as it loads.
Update the config section under package.json to the desired build configuration
Update patches if needed (don't forget to update the printVersion patch in jsc.patch)
npm run download: downloads all needed sources
npm 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.
Distribution
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.
On load, JSC prints the version out to logcat, under "JavaScriptCore.Version" tag.
How to use it with my React Native app
Follow steps below in order for your React Native app to use new version of JSC VM on android:
For React Native version 0.60 and newer
Update jsc-android:
yarn add jsc-android
# Or if you would like to try latest version
# yarn add 'jsc-android@next'
You're done, rebuild your app and enjoy updated version of JSC on android!
For React Native version 0.59
Add jsc-android:
yarn add jsc-android
# Or if you would like to try latest version
# yarn add 'jsc-android@next'
Modify android/build.gradle file to add the 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"
+ }
}
}
Update your app's build.gradle file located in android/app/build.gradle to add the JSC dependency. Please make sure the dependency is before the React Native dependency.
dependencies {
+ // Make sure to put android-jsc at the top
+ implementation "org.webkit:android-jsc:+"
+
compile fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
}
Update your app's build.gradle file located in android/app/build.gradle to use first matched JSC library.
You're done - rebuild your app and enjoy the updated version of JSC on Android!
For React Native version 0.58 below
Add jsc-android:
yarn add jsc-android
# Or if you would like to try latest version
# yarn add 'jsc-android@next'
Modify 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"
+ }
}
}
Update your app's 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:
You're done, rebuild your app and enjoy updated version of JSC on android!
International variant
International variant includes ICU i18n library and necessary data allowing to use e.g. Date.toLocaleString and String.localeCompare that give correct results when using with locales other than en-US. Note that this variant is about 6MiB larger per architecture than default.
To use this variant instead replace the third installation step with:
For React Native version 0.60 and newer, your build.gradle should have a flag to enable this feature.
/**
* Use the international variant of JavaScriptCore
* This variant includes the ICU i18n library to make APIs like `Date.toLocaleString`
* and `String.localeCompare` work when using with locales other than en-US.
* Note that this variant is about 6MiB larger per architecture than the default.
*/
- def useIntlJsc = false
+ def useIntlJsc = true
For React Native version 0.59, replace original artifact id with android-jsc-intl
dependencies {
+ // Make sure to put android-jsc at the the first
+ implementation "org.webkit:android-jsc-intl:+"
+
compile fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
}
For React Native version 0.58 below, replace original resolutionStrategy with this.
How active is development on react-native-community/jsc-android-buildscripts?
The most recent commit recorded on react-native-community/jsc-android-buildscripts was 8 months ago, based on the GitHub push timestamp. The repository has 103 forks — one of the better signals of community interest.
How many stars does react-native-community/jsc-android-buildscripts have?
react-native-community/jsc-android-buildscripts has 1.1k GitHub stars — refresh the page for the live number, or check github.com/react-native-community/jsc-android-buildscripts. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is react-native-community/jsc-android-buildscripts open source?
Yes — react-native-community/jsc-android-buildscripts ships under the BSD-2-Clause license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/react-native-community/jsc-android-buildscripts.
What is react-native-community/jsc-android-buildscripts?
react-native-community/jsc-android-buildscripts (react-native-community/jsc-android-buildscripts) is a JavaScript project on GitHub. From the project's own README: Script for building JavaScriptCore for Android (for React Native but not only)
What language is react-native-community/jsc-android-buildscripts written in?
react-native-community/jsc-android-buildscripts is written primarily in JavaScript. GitHub's language field is based on the largest share of bytes in the default branch.
What license does react-native-community/jsc-android-buildscripts use?
react-native-community/jsc-android-buildscripts is released under the BSD-2-Clause license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about react-native-community/jsc-android-buildscripts?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/react-native-community/jsc-android-buildscripts is the definitive source.
Read full README in the tab above.
Want a second opinion on jsc-android-buildscripts?
Ask an AI that can read this page — one click and you get its take on jsc-android-buildscripts.