Skip to content

Commit

Permalink
Gradle 6.9, Android Gradle Plugin 4.2.1 (facebook#31593)
Browse files Browse the repository at this point in the history
Summary:
Bump Gradle to 6.9 which supports Apple Silicon, also Android Gradle Plugin 4.2.1 which defaults to Java 1.8 so no additional config required.

[Android] [Changed] - Bump Gradle to 6.9, Android Gradle Plugin to 4.2.1

Pull Request resolved: facebook#31593

Test Plan: rn-tester builds and runs as expected

Reviewed By: mdvacca

Differential Revision: D28711942

Pulled By: ShikaSD

fbshipit-source-id: 2a4616cd0f17db7616ab29dea1652717f2cd0f6d
  • Loading branch information
dulmandakh authored and elliscwc committed Jun 17, 2021
1 parent e885a81 commit bcda8ff
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 25 deletions.
8 changes: 2 additions & 6 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,8 @@ task extractJNIFiles {
}

android {
compileSdkVersion 29

compileOptions {
sourceCompatibility(JavaVersion.VERSION_1_8)
targetCompatibility(JavaVersion.VERSION_1_8)
}
compileSdkVersion 30
ndkVersion ANDROID_NDK_VERSION

defaultConfig {
minSdkVersion(21)
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ buildscript {
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
classpath("de.undercouch:gradle-download-task:4.0.2")
classpath("com.android.tools.build:gradle:4.2.1")
classpath("de.undercouch:gradle-download-task:4.1.1")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true

ANDROID_NDK_VERSION=20.1.5948944
android.useAndroidX=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion packages/react-native-codegen/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
classpath("com.android.tools.build:gradle:4.2.1")
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ gradlePlugin {
}

dependencies {
implementation 'com.android.tools.build:gradle:4.1.0'
implementation 'com.android.tools.build:gradle:4.2.1'
// Use the same Gson version that `com.android.tools.build:gradle` depends on.
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.google.guava:guava:29.0-jre'
Expand Down
30 changes: 30 additions & 0 deletions packages/react-native-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

plugins {
`java-gradle-plugin`
`kotlin-dsl`
kotlin("jvm") version "1.4.20"
}

repositories {
google()
jcenter()
}

gradlePlugin {
plugins {
create("reactApp") {
id = "com.facebook.react.app"
implementationClass = "com.facebook.react.ReactAppPlugin"
}
}
}

dependencies {
implementation("com.android.tools.build:gradle:4.2.1")
}
5 changes: 1 addition & 4 deletions packages/rn-tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,8 @@ def useIntlJsc = false

android {
compileSdkVersion 29
ndkVersion ANDROID_NDK_VERSION

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
javaMaxHeapSize "4g"
}
Expand Down
5 changes: 0 additions & 5 deletions template/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ android {

compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "com.helloworld"
minSdkVersion rootProject.ext.minSdkVersion
Expand Down
2 changes: 1 addition & 1 deletion template/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
classpath("com.android.tools.build:gradle:4.2.1")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
2 changes: 1 addition & 1 deletion template/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions tools/build_defs/oss/rn_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ def rn_robolectric_test(name, srcs, vm_args = None, *args, **kwargs):
"-XX:+UseConcMarkSweepGC", # required by -XX:+CMSClassUnloadingEnabled
"-XX:+CMSClassUnloadingEnabled",
"-XX:ReservedCodeCacheSize=150M",
"-Drobolectric.dependency.dir=buck-out/gen/ReactAndroid/src/main/third-party/java/robolectric/4.4",
"-Dlibraries=buck-out/gen/ReactAndroid/src/main/third-party/java/robolectric/4.4/*.jar",
"-Drobolectric.dependency.dir=buck-out/gen/ReactAndroid/src/main/third-party/java/robolectric",
"-Dlibraries=buck-out/gen/ReactAndroid/src/main/third-party/java/robolectric/*.jar",
"-Drobolectric.logging.enabled=true",
"-XX:MaxPermSize=620m",
"-Drobolectric.offline=true",
Expand Down

0 comments on commit bcda8ff

Please sign in to comment.