Skip to content

Commit 22be730

Browse files
committed
a brand new jsc with full es6 support
1 parent 76a59fa commit 22be730

29 files changed

Lines changed: 123 additions & 32 deletions

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ buck-out
4444
.gradle
4545
local.properties
4646
*.iml
47-
/android/
4847

4948
# Node
5049
node_modules

ReactAndroid/build.gradle

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -145,40 +145,13 @@ task prepareGlog(dependsOn: dependenciesPath ? [] : [downloadGlog], type: Copy)
145145
}
146146
}
147147

148-
task downloadJSCHeaders(type: Download) {
149-
// in sync with webkit SVN revision 174650
150-
def jscAPIBaseURL = 'https://raw.githubusercontent.com/WebKit/webkit/38b15a3ba3c1b0798f2036f7cea36ffdc096202e/Source/JavaScriptCore/API/'
151-
def jscHeaderFiles = ['JavaScript.h', 'JSBase.h', 'JSContextRef.h', 'JSObjectRef.h', 'JSStringRef.h', 'JSValueRef.h', 'WebKitAvailability.h']
152-
def output = new File(downloadsDir, 'jsc')
153-
output.mkdirs()
154-
src(jscHeaderFiles.collect { headerName -> "$jscAPIBaseURL$headerName" })
155-
onlyIfNewer true
156-
overwrite false
157-
dest output
158-
}
159-
160-
// Create Android.mk library module based on so files from mvn + include headers fetched from webkit.org
161-
task prepareJSC(dependsOn: dependenciesPath ? [] : [downloadJSCHeaders]) {
162-
doLast {
163-
copy {
164-
from zipTree(configurations.compile.fileCollection { dep -> dep.name == 'android-jsc' }.singleFile)
165-
from dependenciesPath ? "$dependenciesPath/jsc-headers" : {downloadJSCHeaders.dest}
166-
from 'src/main/jni/third-party/jsc'
167-
include 'jni/**/*.so', '*.h', 'Android.mk'
168-
filesMatching('*.h', { fname -> fname.path = "JavaScriptCore/${fname.path}"})
169-
into "$thirdPartyNdkDir/jsc";
170-
}
171-
}
172-
}
173-
174148
task downloadNdkBuildDependencies {
175149
if (!boostPath) {
176150
dependsOn downloadBoost
177151
}
178152
dependsOn downloadDoubleConversion
179153
dependsOn downloadFolly
180154
dependsOn downloadGlog
181-
dependsOn downloadJSCHeaders
182155
}
183156

184157
def getNdkBuildName() {
@@ -232,8 +205,8 @@ def getNdkBuildFullPath() {
232205
return ndkBuildFullPath
233206
}
234207

235-
task buildReactNdkLib(dependsOn: [prepareJSC, prepareBoost, prepareDoubleConversion, prepareFolly, prepareGlog], type: Exec) {
236-
inputs.dir('src/main/jni/react')
208+
task buildReactNdkLib(dependsOn: [prepareBoost, prepareDoubleConversion, prepareFolly, prepareGlog], type: Exec) {
209+
inputs.file('src/main/jni/react')
237210
outputs.dir("$buildDir/react-ndk/all")
238211
commandLine getNdkBuildFullPath(),
239212
'NDK_PROJECT_PATH=null',
@@ -291,7 +264,7 @@ android {
291264

292265
sourceSets.main {
293266
jni.srcDirs = []
294-
jniLibs.srcDirs = ["$buildDir/react-ndk/exported", 'src/main/jni/third-party/jsc/jni']
267+
jniLibs.srcDir "$buildDir/react-ndk/exported"
295268
res.srcDirs = ['src/main/res/devsupport', 'src/main/res/shell', 'src/main/res/views/modal', 'src/main/res/views/uimanager']
296269
java {
297270
srcDirs = ['src/main/java', 'src/main/libraries/soloader/java', 'src/main/jni/first-party/fb/jni/java']
@@ -326,7 +299,6 @@ dependencies {
326299
api "com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}"
327300
api "com.squareup.okhttp3:okhttp-urlconnection:${OKHTTP_VERSION}"
328301
api 'com.squareup.okio:okio:1.14.0'
329-
compile 'org.webkit:android-jsc:r174650'
330302

331303
testImplementation "junit:junit:${JUNIT_VERSION}"
332304
testImplementation "org.powermock:powermock-api-mockito:${POWERMOCK_VERSION}"
6.41 MB
Binary file not shown.
-1.37 MB
Binary file not shown.
8.32 MB
Binary file not shown.
4.61 MB
Binary file not shown.
9.64 MB
Binary file not shown.
5.52 MB
Binary file not shown.
12.1 MB
Binary file not shown.
6.29 MB
Binary file not shown.

0 commit comments

Comments
 (0)