From 6460d2b3e74c3a6e4075e9f12304c16427c3b1b2 Mon Sep 17 00:00:00 2001 From: Blake Friedman Date: Thu, 21 Nov 2024 07:19:35 -0800 Subject: [PATCH] Support Windows sdkmanager.bat (#47874) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47874 We should be searching for the .bat file on Windows to remain compatible with some user setups. Changelog: [Android][Fixed] look for sdkmanager.bat Reviewed By: cipolleschi Differential Revision: D66295240 fbshipit-source-id: 6b79a9aa40f77ed9c5b3d6ad92b1a62e78159223 --- .../react-native/ReactAndroid/hermes-engine/build.gradle.kts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts b/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts index 568d0c5e515cd1..d8b0d5f382f564 100644 --- a/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts +++ b/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts @@ -37,9 +37,13 @@ fun getSDKPath(): String { fun getSDKManagerPath(): String { val metaSdkManagerPath = File("${getSDKPath()}/cmdline-tools/latest/bin/sdkmanager") val ossSdkManagerPath = File("${getSDKPath()}/tools/bin/sdkmanager") + val windowsMetaSdkManagerPath = File("${getSDKPath()}/cmdline-tools/latest/bin/sdkmanager.bat") + val windowsOssSdkManagerPath = File("${getSDKPath()}/tools/bin/sdkmanager.bat") return when { metaSdkManagerPath.exists() -> metaSdkManagerPath.absolutePath + windowsMetaSdkManagerPath.exists() -> windowsMetaSdkManagerPath.absolutePath ossSdkManagerPath.exists() -> ossSdkManagerPath.absolutePath + windowsOssSdkManagerPath.exists() -> windowsOssSdkManagerPath.absolutePath else -> throw GradleException("Could not find sdkmanager executable.") } }