From cceef57be1fca661c10955ecec088ce1ef7aab91 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Tue, 9 May 2023 06:05:46 -0700 Subject: [PATCH] fix(gradle-plugin): fix nightly build regression (#37332) Summary: Nightly builds of Android no longer build due to a recent version format change. ## Changelog: [ANDROID] [FIXED] - Fixed nightly builds of Android no longer building due to a recent version format change Pull Request resolved: https://github.com/facebook/react-native/pull/37332 Test Plan: ``` git clone https://github.com/microsoft/react-native-test-app.git cd react-native-test-app npm run set-react-version nightly cd example yarn android ``` Reviewed By: jacdebug Differential Revision: D45690926 Pulled By: cortinico fbshipit-source-id: dc935733607c2b33ba296b507a98f43ba483e348 --- .../src/main/kotlin/com/facebook/react/utils/DependencyUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/DependencyUtils.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/DependencyUtils.kt index 583fc13f377..fbdf6fe131b 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/DependencyUtils.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/DependencyUtils.kt @@ -84,7 +84,7 @@ internal object DependencyUtils { val versionStringFromFile = reactAndroidProperties["VERSION_NAME"] as? String ?: "" // If on a nightly, we need to fetch the -SNAPSHOT artifact from Sonatype. val versionString = - if (versionStringFromFile.startsWith("0.0.0")) { + if (versionStringFromFile.startsWith("0.0.0") || "-nightly-" in versionStringFromFile) { "$versionStringFromFile-SNAPSHOT" } else { versionStringFromFile