Skip to content

Commit 8821758

Browse files
committed
add arm64 x86_64 support
1 parent 2fcb9f3 commit 8821758

File tree

8 files changed

+18
-34
lines changed

8 files changed

+18
-34
lines changed

RNTester/android/app/build.gradle

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ apply from: "../../../react.gradle"
7676
* Upload all the APKs to the Play Store and people will download
7777
* the correct one based on the CPU architecture of their device.
7878
*/
79-
def enableSeparateBuildPerCPUArchitecture = false
79+
def enableSeparateBuildPerCPUArchitecture = true
8080

8181
/**
8282
* Run Proguard to shrink the Java bytecode in release builds.
@@ -93,9 +93,6 @@ android {
9393
targetSdkVersion 23
9494
versionCode 1
9595
versionName "1.0"
96-
ndk {
97-
abiFilters "armeabi-v7a", "x86"
98-
}
9996
}
10097
signingConfigs {
10198
release {
@@ -110,7 +107,7 @@ android {
110107
enable enableSeparateBuildPerCPUArchitecture
111108
universalApk false
112109
reset()
113-
include "armeabi-v7a", "x86"
110+
include "armeabi-v7a", "x86", "x86_64", "arm64-v8a"
114111
}
115112
}
116113
buildTypes {
@@ -120,19 +117,6 @@ android {
120117
signingConfig signingConfigs.release
121118
}
122119
}
123-
// applicationVariants are e.g. debug, release
124-
applicationVariants.all { variant ->
125-
variant.outputs.each { output ->
126-
// For each separate APK per architecture, set a unique version code as described here:
127-
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
128-
def versionCodes = ["armeabi-v7a":1, "x86":2]
129-
def abi = output.getFilter(OutputFile.ABI)
130-
if (abi != null) { // null for the universal-debug, universal-release variants
131-
output.versionCodeOverride =
132-
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
133-
}
134-
}
135-
}
136120
}
137121

138122
dependencies {

ReactAndroid/build.gradle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def thirdPartyNdkDir = new File("$buildDir/third-party-ndk")
1919

2020
// You need to have following folders in this directory:
2121
// - boost_1_63_0
22-
// - double-conversion-1.1.1
22+
// - double-conversion-1.1.6
2323
// - folly-deprecate-dynamic-initializer
2424
// - glog-0.3.3
2525
// - jsc-headers
@@ -54,16 +54,16 @@ task prepareBoost(dependsOn: boostPath ? [] : [downloadBoost], type: Copy) {
5454
}
5555

5656
task downloadDoubleConversion(dependsOn: createNativeDepsDirectories, type: Download) {
57-
src 'https://github.com/google/double-conversion/archive/v1.1.1.tar.gz'
57+
src 'https://github.com/google/double-conversion/archive/v1.1.6.tar.gz'
5858
onlyIfNewer true
5959
overwrite false
60-
dest new File(downloadsDir, 'double-conversion-1.1.1.tar.gz')
60+
dest new File(downloadsDir, 'double-conversion-1.1.6.tar.gz')
6161
}
6262

6363
task prepareDoubleConversion(dependsOn: dependenciesPath ? [] : [downloadDoubleConversion], type: Copy) {
6464
from dependenciesPath ?: tarTree(downloadDoubleConversion.dest)
6565
from 'src/main/jni/third-party/double-conversion/Android.mk'
66-
include 'double-conversion-1.1.1/src/**/*', 'Android.mk'
66+
include 'double-conversion-1.1.6/src/**/*', 'Android.mk'
6767
filesMatching('*/src/**/*', {fname -> fname.path = "double-conversion/${fname.name}"})
6868
includeEmptyDirs = false
6969
into "$thirdPartyNdkDir/double-conversion"
@@ -290,7 +290,7 @@ android {
290290
}
291291

292292
dependencies {
293-
compile fileTree(dir: 'src/main/third-party/java/infer-annotations/', include: ['*.jar'])
293+
compile fileTree(include: ['*.jar'], dir: 'src/main/third-party/java/infer-annotations/')
294294
compile 'javax.inject:javax.inject:1'
295295
compile 'com.android.support:appcompat-v7:23.0.1'
296296
compile 'com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.0.0'
@@ -301,7 +301,7 @@ dependencies {
301301
compile 'com.squareup.okhttp3:okhttp:3.8.0'
302302
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.8.0'
303303
compile 'com.squareup.okio:okio:1.14.0'
304-
compile 'org.webkit:android-jsc:r174650'
304+
compile project(':android-jsc')
305305

306306
testCompile "junit:junit:${JUNIT_VERSION}"
307307
testCompile "org.powermock:powermock-api-mockito:${POWERMOCK_VERSION}"
@@ -310,8 +310,7 @@ dependencies {
310310
testCompile "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
311311
testCompile "org.easytesting:fest-assert-core:${FEST_ASSERT_CORE_VERSION}"
312312
testCompile "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}"
313-
314-
androidTestCompile fileTree(dir: 'src/main/third-party/java/buck-android-support/', include: ['*.jar'])
313+
androidTestCompile fileTree(include: ['*.jar'], dir: 'src/main/third-party/java/buck-android-support/')
315314
androidTestCompile 'com.android.support.test:runner:0.3'
316315
androidTestCompile "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
317316
}

ReactAndroid/src/main/jni/Application.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
APP_BUILD_SCRIPT := Android.mk
22

3-
APP_ABI := armeabi-v7a x86
3+
APP_ABI := armeabi-v7a x86 arm64-v8a x86_64
44
APP_PLATFORM := android-9
55

66
APP_MK_DIR := $(dir $(lastword $(MAKEFILE_LIST)))

ReactAndroid/src/main/jni/third-party/double-conversion/Android.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ LOCAL_SRC_FILES := \
1616

1717
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
1818

19-
CXX11_FLAGS := -std=c++11 -Wno-unused-variable -Wno-unused-local-typedefs
19+
CXX11_FLAGS := -std=c++1y -Wno-unused-variable -Wno-unused-local-typedefs
2020
LOCAL_CFLAGS += $(CXX11_FLAGS)
2121
LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS)
2222

23-
include $(BUILD_STATIC_LIBRARY)
23+
include $(BUILD_STATIC_LIBRARY)

android-jsc/android-jsc.aar

9.19 MB
Binary file not shown.

android-jsc/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
configurations.maybeCreate("default")
2+
artifacts.add("default", file('android-jsc.aar'))

local-cli/templates/HelloWorld/android/app/build.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,13 @@ android {
103103
targetSdkVersion 22
104104
versionCode 1
105105
versionName "1.0"
106-
ndk {
107-
abiFilters "armeabi-v7a", "x86"
108-
}
109106
}
110107
splits {
111108
abi {
112109
reset()
113110
enable enableSeparateBuildPerCPUArchitecture
114111
universalApk false // If true, also generate a universal APK
115-
include "armeabi-v7a", "x86"
112+
include "armeabi-v7a", "x86", "x86_64", "arm64-v8a"
116113
}
117114
}
118115
buildTypes {

settings.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// Copyright 2004-present Facebook. All Rights Reserved.
22

3-
include ':ReactAndroid', ':RNTester:android:app'
3+
include ':ReactAndroid'
4+
include ':RNTester:android:app'
5+
include ':android-jsc'

0 commit comments

Comments
 (0)