From e9ecd3511e0400596f994484bbb2f6d3e925244c Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Fri, 6 Oct 2023 11:38:59 -0700 Subject: [PATCH] Fix compilation warnings introduced by Gradle 8.4 (#39959) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39959 We're still accessing project.buildDir which will be removed in Gradle 9.0 I'm cleaning it up here. Changelog: [Internal] [Changed] - Fix compilation warnings introduced by Gradle 8.4 Reviewed By: yungsters Differential Revision: D50016573 fbshipit-source-id: de7a725f61b503f08991ebf85b9a002cefab221a --- packages/react-native-gradle-plugin/build.gradle.kts | 1 + .../src/main/kotlin/com/facebook/react/TaskConfiguration.kt | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/react-native-gradle-plugin/build.gradle.kts b/packages/react-native-gradle-plugin/build.gradle.kts index 8934f0f30ba3e4..c4a31beb010e19 100644 --- a/packages/react-native-gradle-plugin/build.gradle.kts +++ b/packages/react-native-gradle-plugin/build.gradle.kts @@ -66,6 +66,7 @@ tasks.withType().configureEach { apiVersion = "1.5" // See comment above on JDK 11 support jvmTarget = "11" + allWarningsAsErrors = true } } diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt index ed5551d0987f3f..e839e5c37ba3b7 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt @@ -23,6 +23,7 @@ internal fun Project.configureReactTasks(variant: Variant, config: ReactExtensio val targetName = variant.name.capitalizeCompat() val targetPath = variant.name + val buildDir = this.layout.buildDirectory.get().asFile // Resources: generated/assets/react//index.android.bundle val resourcesDir = File(buildDir, "generated/res/react/$targetPath") // Bundle: generated/assets/react//index.android.bundle