File tree Expand file tree Collapse file tree 13 files changed +97
-128
lines changed
packages/react-native-gradle-plugin
src/main/kotlin/com/facebook/react
template/android/gradle/wrapper Expand file tree Collapse file tree 13 files changed +97
-128
lines changed Original file line number Diff line number Diff line change 1414# and build a Android application that can be used to run the
1515# tests specified in the scripts/ directory.
1616#
17- FROM reactnativecommunity/react-native-android:7 .0
17+ FROM reactnativecommunity/react-native-android:9 .0
1818
1919LABEL Description="React Native Android Test Image"
20- LABEL maintainer="Héctor Ramos <hector@fb .com>"
20+ LABEL maintainer="Meta Open Source <opensource@meta .com>"
2121
2222# set default environment variables
2323ENV GRADLE_OPTS="-Dorg.gradle.daemon=false -Dfile.encoding=utf-8 -Dorg.gradle.jvmargs=\"-Xmx512m -XX:+HeapDumpOnOutOfMemoryError\""
2424ENV KOTLIN_HOME="packages/react-native/third-party/kotlin"
2525
26- ADD .buckconfig /app/.buckconfig
27- ADD .buckjavaargs /app/.buckjavaargs
28- ADD BUCK /app/BUCK
2926ADD packages/react-native/Libraries /app/packages/react-native/Libraries
3027ADD packages/react-native/ReactAndroid /app/packages/react-native/ReactAndroid
3128ADD packages/react-native/ReactCommon /app/packages/react-native/ReactCommon
3229ADD packages/react-native/React /app/packages/react-native/React
33- ADD keystores /app/keystores
3430ADD packages/react-native-codegen /app/packages/react-native-codegen
3531ADD tools /app/tools
3632ADD scripts /app/scripts
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -653,6 +653,7 @@ android {
653653 buildFeatures {
654654 prefab true
655655 prefabPublishing ! skipPrefabPublishing
656+ buildConfig true
656657 }
657658
658659 prefab {
@@ -813,6 +814,8 @@ react {
813814}
814815
815816kotlin {
817+ // We intentionally don't build on JDK 17 as our tests are broken due to Mockito/PowerMock
818+ // not running well on JDK 17.
816819 jvmToolchain(11 )
817820}
818821
Original file line number Diff line number Diff line change @@ -32,3 +32,7 @@ LIBEVENT_VERSION=2.1.12
3232
3333android.useAndroidX =true
3434android.enableJetifier =true
35+
36+ # We want to have more fine grained control on the Java version for
37+ # ReactAndroid, therefore we disable RGNP Java version alignment mechanism
38+ react.internal.disableJavaVersionAlignment =true
Original file line number Diff line number Diff line change @@ -227,10 +227,6 @@ android {
227227 targetCompatibility = JavaVersion . VERSION_11
228228 }
229229
230- kotlin {
231- jvmToolchain(11 )
232- }
233-
234230 sourceSets {
235231 main {
236232 manifest. srcFile " $hermesDir /android/hermes/src/main/AndroidManifest.xml"
Original file line number Diff line number Diff line change 1111// their settings.gradle.kts file.
1212// More on this here: https://reactnative.dev/contributing/how-to-build-from-source
1313plugins {
14- id(" com.android.library" ) version " 7.4.2 " apply false
15- id(" com.android.application" ) version " 7.4.2 " apply false
14+ id(" com.android.library" ) version " 8.2.1 " apply false
15+ id(" com.android.application" ) version " 8.2.1 " apply false
1616 id(" de.undercouch.download" ) version " 5.0.1" apply false
1717 kotlin(" android" ) version " 1.8.22" apply false
1818}
Original file line number Diff line number Diff line change 1+ # Sat Jan 13 16:13:20 PST 2024
12distributionBase =GRADLE_USER_HOME
23distributionPath =wrapper/dists
3- distributionUrl =https\://services.gradle.org/distributions/gradle-8.0.1 -all.zip
4+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.5 -all.zip
45networkTimeout =10000
56zipStoreBase =GRADLE_USER_HOME
67zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ dependencies {
3737 // The KGP/AGP version is defined by React Native Gradle plugin.
3838 // Therefore we specify an implementation dep rather than a compileOnly.
3939 implementation(" org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22" )
40- implementation(" com.android.tools.build:gradle:7.4.2 " )
40+ implementation(" com.android.tools.build:gradle:8.2.1 " )
4141
4242 implementation(" com.google.code.gson:gson:2.8.9" )
4343 implementation(" com.google.guava:guava:31.0.1-jre" )
@@ -55,11 +55,14 @@ dependencies {
5555}
5656
5757java {
58+ // We intentionally don't build for Java 17 as users will see a cryptic bytecode version
59+ // error first. Instead we produce a Java 11-compatible Gradle Plugin, so that AGP can print their
60+ // nice message showing that JDK 11 (or 17) is required first
5861 sourceCompatibility = JavaVersion .VERSION_11
5962 targetCompatibility = JavaVersion .VERSION_11
6063}
6164
62- kotlin { jvmToolchain(11 ) }
65+ kotlin { jvmToolchain(17 ) }
6366
6467tasks.withType<KotlinCompile > {
6568 kotlinOptions {
Original file line number Diff line number Diff line change 11distributionBase =GRADLE_USER_HOME
22distributionPath =wrapper/dists
3- distributionUrl =https\://services.gradle.org/distributions/gradle-8.0.1 -all.zip
3+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.5 -all.zip
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change @@ -86,13 +86,13 @@ class ReactPlugin : Plugin<Project> {
8686
8787 private fun checkJvmVersion (project : Project ) {
8888 val jvmVersion = Jvm .current()?.javaVersion?.majorVersion
89- if ((jvmVersion?.toIntOrNull() ? : 0 ) <= 8 ) {
89+ if ((jvmVersion?.toIntOrNull() ? : 0 ) <= 16 ) {
9090 project.logger.error(
9191 """
9292
9393 ********************************************************************************
9494
95- ERROR: requires JDK11 or higher.
95+ ERROR: requires JDK17 or higher.
9696 Incompatible major version detected: '$jvmVersion '
9797
9898 ********************************************************************************
You can’t perform that action at this time.
0 commit comments