Skip to content

Commit

Permalink
draft: bump AGP to 7 (#32589)
Browse files Browse the repository at this point in the history
Summary:
Bump Android Gradle Plugin to 7.

## Changelog

[Android] [Changed] - Bump Android Gradle Plugin to 7.

This will make Java 11 a requirement for users that are either:
* Cloning react-native to contribute
* Using react-native while building from source.
* Creating new project from the template.

Pull Request resolved: #32589

Test Plan: CI is green

Reviewed By: ShikaSD

Differential Revision: D32427945

Pulled By: cortinico

fbshipit-source-id: c1ea464d87c3e397616c55154b3d8b1c3ea6c592
  • Loading branch information
dulmandakh authored and facebook-github-bot committed Nov 24, 2021
1 parent c10dc49 commit 272cfe5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
6 changes: 6 additions & 0 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ react {
}

afterEvaluate {

// Needed as some of the native sources needs to be downloaded
// before configureNdkBuildDebug could be executed.
configureNdkBuildDebug.dependsOn(preBuild)
configureNdkBuildRelease.dependsOn(preBuild)

publishing {
publications {
release(MavenPublication) {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}
dependencies {
val kotlin_version: String by project
classpath("com.android.tools.build:gradle:4.2.2")
classpath("com.android.tools.build:gradle:7.0.1")
classpath("de.undercouch:gradle-download-task:4.1.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
// NOTE: Do not place your application dependencies here; they belong
Expand Down
9 changes: 4 additions & 5 deletions packages/rn-tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ android {
ndkPath project.property("ANDROID_NDK_PATH")
}

dexOptions {
javaMaxHeapSize "4g"
}
flavorDimensions "vm"
productFlavors {
hermes {
Expand Down Expand Up @@ -291,14 +288,14 @@ if (enableCodegen) {
def packageReactDebugNdkLibs = tasks.register("packageReactDebugNdkLibs", Copy) {
// TODO: handle extracting .so from prebuilt :ReactAndroid.
dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
dependsOn("generateCodegenSchemaFromJavaScript")
dependsOn("generateCodegenArtifactsFromSchema")
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
into("$buildDir/react-ndk/exported")
}
def packageReactReleaseNdkLibs = tasks.register("packageReactReleaseNdkLibs", Copy) {
// TODO: handle extracting .so from prebuilt :ReactAndroid.
dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
dependsOn("generateCodegenSchemaFromJavaScript")
dependsOn("generateCodegenArtifactsFromSchema")
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
into("$buildDir/react-ndk/exported")
}
Expand All @@ -317,8 +314,10 @@ if (enableCodegen) {
}

afterEvaluate {
configureNdkBuildRelease.dependsOn(packageReactReleaseNdkLibs)
preHermesReleaseBuild.dependsOn(packageReactReleaseNdkLibs)
preJscReleaseBuild.dependsOn(packageReactReleaseNdkLibs)
configureNdkBuildDebug.dependsOn(packageReactDebugNdkLibs)
preHermesDebugBuild.dependsOn(packageReactDebugNdkLibs)
preJscDebugBuild.dependsOn(packageReactDebugNdkLibs)
clean.dependsOn(cleanProjectNdkBuild)
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 {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath("com.android.tools.build:gradle:7.0.1")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down

0 comments on commit 272cfe5

Please sign in to comment.