Skip to content

Commit 74bfd7f

Browse files
committed
feat: use agp9 for core
1 parent 87d49e2 commit 74bfd7f

7 files changed

Lines changed: 26 additions & 28 deletions

File tree

gradle.properties

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ org.gradle.caching=true
44

55
android.useAndroidX=true
66

7-
# Those 2 properties are needed to make our project compatible with
8-
# AGP 9.0.0 for the time being. Ideally we should not opt-out of
9-
# builtInKotlin and newDsl once AGP 9.0.0 hits stable.
10-
# More on this: https://developer.android.com/build/releases/agp-preview#android-gradle-plugin-built-in-kotlin
11-
android.builtInKotlin=false
12-
android.newDsl=false
137

148
# Use this property to specify which architecture you want to build.
159
# You can also override it from the CLI using

packages/react-native-popup-menu-android/android/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
plugins {
99
id("com.facebook.react")
1010
id("com.android.library")
11-
id("org.jetbrains.kotlin.android")
1211
}
1312

1413
android {

packages/react-native/ReactAndroid/build.gradle.kts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ plugins {
1818
id("com.facebook.react")
1919
alias(libs.plugins.android.library)
2020
alias(libs.plugins.download)
21-
alias(libs.plugins.kotlin.android)
2221
alias(libs.plugins.ktfmt)
2322
}
2423

@@ -611,19 +610,17 @@ android {
611610
":packages:react-native:ReactAndroid:hermes-engine:preBuild"
612611
)
613612

614-
sourceSets.getByName("main") {
615-
res.setSrcDirs(
616-
listOf(
617-
"src/main/res/devsupport",
618-
"src/main/res/shell",
619-
"src/main/res/views/alert",
620-
"src/main/res/views/modal",
621-
"src/main/res/views/uimanager",
622-
"src/main/res/views/view",
623-
)
624-
)
625-
java.exclude("com/facebook/react/processing")
626-
java.exclude("com/facebook/react/module/processing")
613+
sourceSets {
614+
named("main") {
615+
res.srcDirs(
616+
"src/main/res/devsupport",
617+
"src/main/res/shell",
618+
"src/main/res/views/alert",
619+
"src/main/res/views/modal",
620+
"src/main/res/views/uimanager",
621+
"src/main/res/views/view",
622+
)
623+
}
627624
}
628625

629626
lint {
@@ -676,6 +673,11 @@ android {
676673
}
677674
}
678675

676+
tasks.withType<JavaCompile>().configureEach {
677+
exclude("com/facebook/react/processing/**")
678+
exclude("com/facebook/react/module/processing/**")
679+
}
680+
679681
tasks.withType<KotlinCompile>().configureEach {
680682
exclude("com/facebook/annotationprocessors/**")
681683
exclude("com/facebook/react/processing/**")
@@ -690,6 +692,7 @@ dependencies {
690692
api(libs.androidx.appcompat)
691693
api(libs.androidx.appcompat.resources)
692694
api(libs.androidx.autofill)
695+
api(libs.androidx.collection)
693696
api(libs.androidx.swiperefreshlayout)
694697
api(libs.androidx.tracing)
695698
api(libs.androidx.window)

packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,11 @@ android {
408408
}
409409
}
410410

411-
sourceSets.getByName("main") {
412-
manifest.srcFile("$hermesDir/android/hermes/src/main/AndroidManifest.xml")
413-
java.srcDirs("$hermesDir/lib/Platform/Intl/java", "$hermesDir/lib/Platform/Unicode/java")
411+
sourceSets {
412+
named("main") {
413+
manifest.srcFile("$hermesDir/android/hermes/src/main/AndroidManifest.xml")
414+
java.srcDirs("$hermesDir/lib/Platform/Intl/java", "$hermesDir/lib/Platform/Unicode/java")
415+
}
414416
}
415417

416418
buildFeatures {

packages/react-native/gradle/libs.versions.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ compileSdk = "36"
66
buildTools = "36.0.0"
77
ndkVersion = "27.1.12297006"
88
# Dependencies versions
9-
agp = "8.12.0"
9+
agp = "9.2.1"
1010
androidx-annotation = "1.6.0"
1111
androidx-appcompat = "1.7.0"
1212
androidx-autofill = "1.3.0"
13+
androidx-collection = "1.4.0"
1314
androidx-benchmark-macro-junit4 = "1.3.3"
1415
androidx-profileinstaller = "1.4.1"
1516
androidx-swiperefreshlayout = "1.1.0"
@@ -56,6 +57,7 @@ androidx-annotation = { module = "androidx.annotation:annotation", version.ref =
5657
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
5758
androidx-appcompat-resources = { module = "androidx.appcompat:appcompat-resources", version.ref = "androidx-appcompat" }
5859
androidx-autofill = { module = "androidx.autofill:autofill", version.ref = "androidx-autofill" }
60+
androidx-collection = { module = "androidx.collection:collection", version.ref = "androidx-collection" }
5961
androidx-benchmark-macro-junit4 = { group = "androidx.benchmark", name = "benchmark-macro-junit4", version.ref = "androidx-benchmark-macro-junit4" }
6062
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" }
6163
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-junit" }

packages/rn-tester/android/app/benchmark/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
plugins {
99
alias(libs.plugins.android.test)
10-
alias(libs.plugins.kotlin.android)
1110
}
1211

1312
android {

packages/rn-tester/android/app/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
1010
plugins {
1111
id("com.facebook.react")
1212
alias(libs.plugins.android.application)
13-
alias(libs.plugins.kotlin.android)
1413
}
1514

1615
val reactNativeDirPath = "$rootDir/packages/react-native"
@@ -135,7 +134,7 @@ android {
135134
}
136135
sourceSets.named("main") {
137136
// SampleTurboModule.
138-
java.srcDirs(
137+
kotlin.srcDirs(
139138
"$reactNativeDirPath/ReactCommon/react/nativemodule/samples/platform/android",
140139
)
141140
res.setSrcDirs(

0 commit comments

Comments
 (0)