From 490db92562df3baf6dc38737778179065f378715 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Mon, 2 Dec 2024 03:22:32 -0800 Subject: [PATCH] Gradle to 8.11.1 (#48026) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48026 This should mitigate this particular issue we're seeing on Windows: - https://github.com/facebook/react-native/issues/46210 Changelog: [Android] [Changed] - Gradle to 8.11.1 Reviewed By: javache Differential Revision: D66600321 fbshipit-source-id: d58437485222e189d90bcf4d6b41ca956449ed22 --- gradle/wrapper/gradle-wrapper.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../com/facebook/react/tasks/BundleHermesCTask.kt | 10 +++++++--- .../android/gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 79eb9d003feaef..c1d5e0185987c5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/packages/gradle-plugin/gradle/wrapper/gradle-wrapper.properties b/packages/gradle-plugin/gradle/wrapper/gradle-wrapper.properties index 79eb9d003feaef..c1d5e0185987c5 100644 --- a/packages/gradle-plugin/gradle/wrapper/gradle-wrapper.properties +++ b/packages/gradle-plugin/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/BundleHermesCTask.kt b/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/BundleHermesCTask.kt index 78e5a9b2606ce5..e0a5f8e29afca9 100644 --- a/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/BundleHermesCTask.kt +++ b/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/BundleHermesCTask.kt @@ -12,6 +12,7 @@ import com.facebook.react.utils.detectOSAwareHermesCommand import com.facebook.react.utils.moveTo import com.facebook.react.utils.windowsAwareCommandLine import java.io.File +import javax.inject.Inject import org.gradle.api.DefaultTask import org.gradle.api.file.ConfigurableFileTree import org.gradle.api.file.DirectoryProperty @@ -19,6 +20,7 @@ import org.gradle.api.file.RegularFileProperty import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.* +import org.gradle.process.ExecOperations abstract class BundleHermesCTask : DefaultTask() { @@ -26,6 +28,8 @@ abstract class BundleHermesCTask : DefaultTask() { group = "react" } + @get:Inject abstract val execOperations: ExecOperations + @get:Internal abstract val root: DirectoryProperty @get:InputFiles @@ -127,9 +131,9 @@ abstract class BundleHermesCTask : DefaultTask() { File(jsIntermediateSourceMapsDir.get().asFile, "$bundleAssetName.compiler.map") private fun runCommand(command: List) { - project.exec { - it.workingDir(root.get().asFile) - it.commandLine(command) + execOperations.exec { exec -> + exec.workingDir(root.get().asFile) + exec.commandLine(command) } } diff --git a/packages/helloworld/android/gradle/wrapper/gradle-wrapper.properties b/packages/helloworld/android/gradle/wrapper/gradle-wrapper.properties index 79eb9d003feaef..c1d5e0185987c5 100644 --- a/packages/helloworld/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/helloworld/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME