Skip to content

Commit 618a23f

Browse files
authored
Merge pull request #145 from Kudo/merge_for_upstream
Merge changes from @kudo-ci/jsc-android@250230.2.1
2 parents 15f648b + 6926235 commit 618a23f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+6540
-2636
lines changed

.circleci/config.yml

Lines changed: 0 additions & 84 deletions
This file was deleted.

.github/workflows/build_and_test.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Build jsc-android and test
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
container: reactnativecommunity/react-native-android:2019-9-4
9+
10+
steps:
11+
- uses: actions/checkout@v1
12+
13+
- name: Install packages
14+
run: |
15+
apt-get update
16+
apt-get install coreutils realpath curl git subversion python3.5 python3.5-dev ruby gperf -y
17+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
18+
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
19+
echo 'export NVM_DIR="$HOME/.nvm"' >> "${HOME}/.bashrc"
20+
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> "${HOME}/.bashrc"
21+
source "${HOME}/.bashrc"
22+
nvm install 10
23+
nvm use 10
24+
nvm alias default 10
25+
shell: bash
26+
27+
- name: Install Android packages
28+
run: |
29+
sdkmanager \
30+
"lldb;3.0" \
31+
"cmake;3.10.2.4988404"
32+
shell: bash
33+
- name: Build
34+
run: |
35+
yarn clean
36+
yarn download
37+
yarn start
38+
shell: bash
39+
40+
- name: Archive
41+
run: |
42+
mkdir -p archive
43+
mv dist archive/
44+
mv dist.unstripped archive/
45+
shell: bash
46+
47+
- uses: actions/upload-artifact@master
48+
with:
49+
name: archive
50+
path: archive
51+
52+
53+
test:
54+
needs: build
55+
runs-on: macOS-latest
56+
57+
steps:
58+
- uses: actions/checkout@v1
59+
60+
- uses: actions/download-artifact@master
61+
with:
62+
name: archive
63+
path: archive
64+
65+
- name: Launch AVD
66+
run: |
67+
source scripts/android-setup.sh
68+
export PATH="${ANDROID_HOME}/emulator:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${PATH}"
69+
export AVD_PACKAGES="system-images;android-${ANDROID_SDK_TARGET_API_LEVEL};google_apis;${AVD_ABI}"
70+
sdkmanager "${AVD_PACKAGES}"
71+
createAVD
72+
launchAVD &
73+
shell: bash
74+
75+
- name: Wait AVD
76+
run: |
77+
export PATH="${ANDROID_HOME}/emulator:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${PATH}"
78+
source scripts/android-setup.sh
79+
set +e +o pipefail
80+
waitForAVD
81+
shell: bash
82+
83+
- name: Run test
84+
run: |
85+
mv archive/dist .
86+
cd test
87+
yarn
88+
cd android && ./gradlew assembleDebug assembleAndroidTest connectedAndroidTest
89+
shell: bash

README.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[![npm version](https://badge.fury.io/js/jsc-android.svg)](https://badge.fury.io/js/jsc-android)
2-
[![CircleCI](https://circleci.com/gh/react-native-community/jsc-android-buildscripts.svg?style=svg)](https://circleci.com/gh/react-native-community/jsc-android-buildscripts)
2+
![GitHub Actions CI](https://github.com/react-native-community/jsc-android-buildscripts/workflows/Build%20jsc-android%20and%20test/badge.svg)
33

44
# JSC build scripts for Android
55

@@ -17,8 +17,8 @@ This project is based on [facebook/android-jsc](https://github.com/facebook/andr
1717
* Run `sdkmanager --list` and install all platforms, tools, buildtool v28.0.3, cmake (android images are not needed)
1818
* Set `$ANDROID_HOME` to the correct path (in ~/.bashrc or similar)
1919
* Set `export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools/bin`
20-
* Android NDK r17c: download from [NDK Archives](https://developer.android.com/ndk/downloads/older_releases.html)
21-
* Set `export ANDROID_NDK=/path/to/android-ndk-r17c`
20+
* Android NDK r19c: download from [NDK Archives](https://developer.android.com/ndk/downloads/older_releases.html)
21+
* Set `export ANDROID_NDK=/path/to/android-ndk-r19c`
2222
* Make sure you have Ruby (>2.3), Python (>2.7), Git, SVN, gperf
2323

2424
## Build instructions
@@ -54,21 +54,23 @@ Follow steps below in order for your React Native app to use new version of JSC
5454
yarn add jsc-android
5555
5656
# Or if you would like to try latest version
57-
# yarn add 'jsc-android@canary`
57+
# yarn add 'jsc-android@next'
5858
5959
```
6060

6161
2. You're done, rebuild your app and enjoy updated version of JSC on android!
6262

6363
### For React Native version 0.59
6464

65-
1. Add `jsc-android` to the "dependencies" section in your `package.json`:
66-
```diff
67-
dependencies {
68-
+ "jsc-android": "241213.x.x",
65+
1. Add `jsc-android`:
66+
6967
```
68+
yarn add jsc-android
7069
71-
then run `npm install` or `yarn` (depending on which npm client you use) in order for the new dependency to be installed in `node_modules`
70+
# Or if you would like to try latest version
71+
# yarn add 'jsc-android@next'
72+
73+
```
7274

7375
2. Modify `android/build.gradle` file to add the new local maven repository packaged in the `jsc-android` package to the search path:
7476
```diff
@@ -94,7 +96,7 @@ allprojects {
9496

9597
dependencies {
9698
+ // Make sure to put android-jsc at the top
97-
+ implementation "org.webkit:android-jsc:r241213"
99+
+ implementation "org.webkit:android-jsc:+"
98100
+
99101
compile fileTree(dir: "libs", include: ["*.jar"])
100102
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
@@ -118,13 +120,15 @@ android {
118120

119121
### For React Native version 0.58 below
120122

121-
1. Add `jsc-android` to the "dependencies" section in your `package.json`:
122-
```diff
123-
dependencies {
124-
+ "jsc-android": "241213.x.x",
123+
1. Add `jsc-android`:
124+
125125
```
126+
yarn add jsc-android
126127
127-
then run `npm install` or `yarn` (depending which npm client you use) in order for the new dependency to be installed in `node_modules`
128+
# Or if you would like to try latest version
129+
# yarn add 'jsc-android@next'
130+
131+
```
128132

129133
2. Modify `android/build.gradle` file to add new local maven repository packaged in the `jsc-android` package to the search path:
130134
```diff
@@ -151,7 +155,7 @@ allprojects {
151155

152156
+configurations.all {
153157
+ resolutionStrategy {
154-
+ force 'org.webkit:android-jsc:r241213'
158+
+ force 'org.webkit:android-jsc:+'
155159
+ }
156160
+}
157161

@@ -189,7 +193,7 @@ For React Native version 0.59, replace original artifact id with `android-jsc-in
189193

190194
dependencies {
191195
+ // Make sure to put android-jsc at the the first
192-
+ implementation "org.webkit:android-jsc-intl:r241213"
196+
+ implementation "org.webkit:android-jsc-intl:+"
193197
+
194198
compile fileTree(dir: "libs", include: ["*.jar"])
195199
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"

lib/android-jsc/build.gradle

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
apply plugin: 'com.android.library'
22

3+
def distDir = project.findProperty("distDir") ?: ""
4+
def jniLibsDir = project.findProperty("jniLibsDir") ?: ""
5+
def revision = project.findProperty("revision") ?: "".replaceAll("\\s", "")
6+
def i18n = project.findProperty("i18n") ?: ""
7+
8+
if (!distDir) throw new RuntimeException("expecting --project-prop distDir=??? but was empty")
9+
if (!jniLibsDir) throw new RuntimeException("expecting --project-prop jniLibsDir=??? but was empty")
10+
if (!revision) throw new RuntimeException("expecting --project-prop revision=??? but was empty")
11+
if (!i18n) throw new RuntimeException("expecting --project-prop i18n=??? but was empty")
12+
313
android {
414
compileSdkVersion 28
515

@@ -12,7 +22,7 @@ android {
1222

1323
sourceSets {
1424
main {
15-
jniLibs.srcDirs = ["${rootDir}/../build/compiled"]
25+
jniLibs.srcDirs = ["${jniLibsDir}"]
1626
}
1727
}
1828

@@ -26,16 +36,6 @@ dependencies {}
2636
apply plugin: 'maven'
2737

2838
task createAAR(type: Upload) {
29-
def distDir = "${rootDir}/../dist"
30-
31-
def revision = project.findProperty("revision") ?: "".replaceAll("\\s", "")
32-
def i18n = project.findProperty("i18n") ?: ""
33-
34-
doFirst {
35-
if (!revision) throw new RuntimeException("expecting --project-prop revision=??? but was empty")
36-
if (!i18n) throw new RuntimeException("expecting --project-prop i18n=??? but was empty")
37-
}
38-
3939
project.group = "org.webkit"
4040
def artifactName = Boolean.valueOf(i18n) ? "android-jsc-intl" : "android-jsc"
4141
project.version = "r${revision}"

lib/cppruntime/build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
apply plugin: 'com.android.library'
22

3+
def distDir = project.findProperty("distDir") ?: ""
4+
def jniLibsDir = project.findProperty("jniLibsDir") ?: ""
5+
def revision = project.findProperty("revision") ?: "".replaceAll("\\s", "")
6+
7+
if (!distDir) throw new RuntimeException("expecting --project-prop distDir=??? but was empty")
8+
if (!jniLibsDir) throw new RuntimeException("expecting --project-prop jniLibsDir=??? but was empty")
9+
if (!revision) throw new RuntimeException("expecting --project-prop revision=??? but was empty")
10+
311
android {
412
compileSdkVersion 28
513

@@ -12,7 +20,7 @@ android {
1220

1321
sourceSets {
1422
main {
15-
jniLibs.srcDirs = ["${rootDir}/../build/cppruntime"]
23+
jniLibs.srcDirs = ["${jniLibsDir}"]
1624
}
1725
}
1826
}
@@ -22,14 +30,6 @@ dependencies {}
2230
apply plugin: 'maven'
2331

2432
task createAAR(type: Upload) {
25-
def distDir = "${rootDir}/../dist"
26-
27-
def revision = project.findProperty("revision") ?: "".replaceAll("\\s", "")
28-
29-
doFirst {
30-
if (!revision) throw new RuntimeException("expecting --project-prop revision=??? but was empty")
31-
}
32-
3333
project.group = "org.webkit"
3434
project.version = "r${revision}"
3535

package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "jsc-android",
3-
"version": "245459.0.0",
3+
"version": "250230.2.1",
44
"description": "Pre-build version of JavaScriptCore to be used by React Native apps",
55
"repository": {
66
"type": "git",
7-
"url": "git+https://github.com/react-community/jsc-android-buildscripts.git"
7+
"url": "git+https://github.com/react-native-community/jsc-android-buildscripts.git"
88
},
99
"keywords": [
1010
"react-native",
@@ -13,9 +13,9 @@
1313
],
1414
"license": "BSD-2-Clause",
1515
"bugs": {
16-
"url": "https://github.com/react-community/jsc-android-buildscripts/issues"
16+
"url": "https://github.com/react-native-community/jsc-android-buildscripts/issues"
1717
},
18-
"homepage": "https://github.com/react-community/jsc-android-buildscripts#readme",
18+
"homepage": "https://github.com/react-native-community/jsc-android-buildscripts#readme",
1919
"files": [
2020
"/dist"
2121
],
@@ -26,7 +26,12 @@
2626
"start": "./scripts/start.sh"
2727
},
2828
"config": {
29-
"webkitGTK": "2.24.2",
29+
"webkitGTK": "2.26.1",
3030
"chromiumICUCommit": "64e5d7d43a1ff205e3787ab6150bbc1a1837332b"
31+
},
32+
"devDependencies": {
33+
"commander": "^4.0.1",
34+
"rimraf": "^3.0.0",
35+
"semver": "^6.3.0"
3136
}
3237
}

0 commit comments

Comments
 (0)