Skip to content

Commit

Permalink
Support Windows sdkmanager.bat (#47874)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
blakef authored and facebook-github-bot committed Nov 21, 2024
1 parent b8419b2 commit 6460d2b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}
}
Expand Down

1 comment on commit 6460d2b

@MOH9l
Copy link

@MOH9l MOH9l commented on 6460d2b Nov 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍®️

Please sign in to comment.