Skip to content

Commit

Permalink
build: Resolve react-native-gradle-plugin incompatability
Browse files Browse the repository at this point in the history
Due to host app requirements, we must use AGP 7.2.1. The included patch
disables logic requiring AGP 7.3. The logic appears to not be required
for our use cases in the Demo editor or host apps.

We should remove this patch once we upgrade past AGP 7.3.
  • Loading branch information
dcalhoun committed Jun 21, 2023
1 parent 4d49c31 commit 437450e
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions patches/react-native-gradle-plugin+0.71.19.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@oguzkocer will remove this patch once AGP 8.0+ update is complete

diff --git a/node_modules/react-native-gradle-plugin/build.gradle.kts b/node_modules/react-native-gradle-plugin/build.gradle.kts
index 5ea92ee..4a4589a 100644
--- a/node_modules/react-native-gradle-plugin/build.gradle.kts
+++ b/node_modules/react-native-gradle-plugin/build.gradle.kts
@@ -33,7 +33,7 @@ group = "com.facebook.react"

dependencies {
implementation(gradleApi())
- implementation("com.android.tools.build:gradle:7.3.1")
+ implementation("com.android.tools.build:gradle:7.2.1")
implementation("com.google.code.gson:gson:2.8.9")
implementation("com.google.guava:guava:31.0.1-jre")
implementation("com.squareup:javapoet:1.13.0")
diff --git a/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt b/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt
index c7db4db..d9a1734 100644
--- a/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt
+++ b/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt
@@ -52,6 +52,7 @@ internal fun Project.configureReactTasks(variant: Variant, config: ReactExtensio

if (!isDebuggableVariant) {
val entryFileEnvVariable = System.getenv("ENTRY_FILE")
+ @Suppress("UNUSED_VARIABLE")
val bundleTask =
tasks.register("createBundle${targetName}JsAndAssets", BundleHermesCTask::class.java) {
it.root.set(config.root)
@@ -76,6 +77,6 @@ internal fun Project.configureReactTasks(variant: Variant, config: ReactExtensio
// Currently broken inside AGP 7.3 We need to wait for a release of AGP 7.4 in order to use
// the addGeneratedSourceDirectory API.
// variant.sources.res?.addGeneratedSourceDirectory(bundleTask, BundleHermesCTask::resourcesDir)
- variant.sources.assets?.addGeneratedSourceDirectory(bundleTask, BundleHermesCTask::jsBundleDir)
+ // variant.sources.assets?.addGeneratedSourceDirectory(bundleTask, BundleHermesCTask::jsBundleDir)
}
}

0 comments on commit 437450e

Please sign in to comment.