Skip to content

Commit 6e35689

Browse files
gengjiawenfacebook-github-bot
authored andcommitted
bump android gradle to 3.1.4 (#20767)
Summary: Bump android gradle plugin to 3.1.4. We have been stay to 2.x too long. With 3.x we can have instant run and great performance and new features brought by google. Also thanks to CFKevinRef great pr to make this possible. pass all current ci. I have also tested RNTester release version works without crash. #17967. [GENERAL] [ANDROID] [FEATURE] - bump android gradle to 3.1.4 Pull Request resolved: #20767 Differential Revision: D9437576 Pulled By: hramos fbshipit-source-id: 6084056a1390582a75a879918f2538b0480f6299
1 parent 044b399 commit 6e35689

File tree

5 files changed

+33
-45
lines changed

5 files changed

+33
-45
lines changed

RNTester/android/app/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ android {
140140
}
141141

142142
dependencies {
143-
compile fileTree(dir: 'libs', include: ['*.jar'])
144-
compile 'com.android.support:appcompat-v7:27.1.1'
143+
implementation fileTree(dir: 'libs', include: ['*.jar'])
144+
implementation 'com.android.support:appcompat-v7:27.1.1'
145145

146146
// Build React Native from source
147-
compile project(':ReactAndroid')
147+
implementation project(':ReactAndroid')
148148
}

ReactAndroid/build.gradle

+21-21
Original file line numberDiff line numberDiff line change
@@ -293,29 +293,29 @@ android {
293293
}
294294

295295
dependencies {
296-
compile 'com.facebook.infer.annotation:infer-annotation:0.11.2'
297-
compile 'javax.inject:javax.inject:1'
298-
compile 'com.android.support:appcompat-v7:27.1.1'
299-
compile "com.facebook.fresco:fresco:${FRESCO_VERSION}"
300-
compile "com.facebook.fresco:imagepipeline-okhttp3:${FRESCO_VERSION}"
301-
compile 'com.facebook.soloader:soloader:0.5.1'
302-
compile 'com.google.code.findbugs:jsr305:3.0.2'
303-
compile "com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}"
304-
compile "com.squareup.okhttp3:okhttp-urlconnection:${OKHTTP_VERSION}"
305-
compile 'com.squareup.okio:okio:1.14.0'
296+
api 'com.facebook.infer.annotation:infer-annotation:0.11.2'
297+
api 'javax.inject:javax.inject:1'
298+
api 'com.android.support:appcompat-v7:27.1.1'
299+
api "com.facebook.fresco:fresco:${FRESCO_VERSION}"
300+
api "com.facebook.fresco:imagepipeline-okhttp3:${FRESCO_VERSION}"
301+
api 'com.facebook.soloader:soloader:0.5.1'
302+
api 'com.google.code.findbugs:jsr305:3.0.2'
303+
api "com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}"
304+
api "com.squareup.okhttp3:okhttp-urlconnection:${OKHTTP_VERSION}"
305+
api 'com.squareup.okio:okio:1.14.0'
306306
compile 'org.webkit:android-jsc:r174650'
307307

308-
testCompile "junit:junit:${JUNIT_VERSION}"
309-
testCompile "org.powermock:powermock-api-mockito:${POWERMOCK_VERSION}"
310-
testCompile "org.powermock:powermock-module-junit4-rule:${POWERMOCK_VERSION}"
311-
testCompile "org.powermock:powermock-classloading-xstream:${POWERMOCK_VERSION}"
312-
testCompile "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
313-
testCompile "org.easytesting:fest-assert-core:${FEST_ASSERT_CORE_VERSION}"
314-
testCompile "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}"
315-
316-
androidTestCompile fileTree(dir: 'src/main/third-party/java/buck-android-support/', include: ['*.jar'])
317-
androidTestCompile 'com.android.support.test:runner:0.3'
318-
androidTestCompile "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
308+
testImplementation "junit:junit:${JUNIT_VERSION}"
309+
testImplementation "org.powermock:powermock-api-mockito:${POWERMOCK_VERSION}"
310+
testImplementation "org.powermock:powermock-module-junit4-rule:${POWERMOCK_VERSION}"
311+
testImplementation "org.powermock:powermock-classloading-xstream:${POWERMOCK_VERSION}"
312+
testImplementation "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
313+
testImplementation "org.easytesting:fest-assert-core:${FEST_ASSERT_CORE_VERSION}"
314+
testImplementation "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}"
315+
316+
androidTestImplementation fileTree(dir: 'src/main/third-party/java/buck-android-support/', include: ['*.jar'])
317+
androidTestImplementation 'com.android.support.test:runner:0.3'
318+
androidTestImplementation "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
319319
}
320320

321321
apply from: 'release.gradle'

build.gradle

+3-9
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@ buildscript {
77
repositories {
88
jcenter()
99
mavenLocal()
10-
maven {
11-
url 'https://maven.google.com/'
12-
name 'Google'
13-
}
10+
google()
1411
}
1512
dependencies {
16-
classpath 'com.android.tools.build:gradle:2.3.3'
13+
classpath 'com.android.tools.build:gradle:3.1.4'
1714
classpath 'de.undercouch:gradle-download-task:3.4.3'
1815

1916
// NOTE: Do not place your application dependencies here; they belong
@@ -25,10 +22,7 @@ allprojects {
2522
repositories {
2623
jcenter()
2724
mavenLocal()
28-
maven {
29-
url 'https://maven.google.com/'
30-
name 'Google'
31-
}
25+
google()
3226

3327
def androidSdk = System.getenv("ANDROID_SDK")
3428
maven {

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ android {
137137
}
138138

139139
dependencies {
140-
compile fileTree(dir: "libs", include: ["*.jar"])
141-
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
142-
compile "com.facebook.react:react-native:+" // From node_modules
140+
implementation fileTree(dir: "libs", include: ["*.jar"])
141+
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
142+
implementation "com.facebook.react:react-native:+" // From node_modules
143143
}
144144

145145
// Run this once to be able to run the application with BUCK

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

+3-9
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
buildscript {
44
repositories {
55
jcenter()
6-
maven {
7-
url 'https://maven.google.com/'
8-
name 'Google'
9-
}
6+
google()
107
}
118
dependencies {
12-
classpath 'com.android.tools.build:gradle:2.3.3'
9+
classpath 'com.android.tools.build:gradle:3.1.4'
1310

1411
// NOTE: Do not place your application dependencies here; they belong
1512
// in the individual module build.gradle files
@@ -24,10 +21,7 @@ allprojects {
2421
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
2522
url "$rootDir/../node_modules/react-native/android"
2623
}
27-
maven {
28-
url 'https://maven.google.com/'
29-
name 'Google'
30-
}
24+
google()
3125
}
3226
}
3327

0 commit comments

Comments
 (0)