Skip to content

Commit

Permalink
Update android.cake
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarinho committed Jun 3, 2021
1 parent 1aefe18 commit de8f42a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion eng/devices/android.cake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ bool DEVICE_BOOT_WAIT = Argument("wait", true);
// set up env
var ANDROID_SDK_ROOT = Argument("android", EnvironmentVariable("ANDROID_SDK_ROOT") ?? EnvironmentVariable("ANDROID_HOME"));
if (string.IsNullOrEmpty(ANDROID_SDK_ROOT)) {
throw new Exception("Environment variable 'ANDROID_SDK_ROOT' or 'ANDROID_HOME' must be set to the Android SDK root.");
if(!string.IsNullOrEmpty(EnvironmentVariable("ANDROIDSDK")))
{
ANDROID_SDK_ROOT = EnvironmentVariable("ANDROIDSDK").Replace("/tools/android","")
}
else {
throw new Exception("Environment variable 'ANDROID_SDK_ROOT' or 'ANDROID_HOME' must be set to the Android SDK root.");
}
}
System.Environment.SetEnvironmentVariable("PATH",
$"{ANDROID_SDK_ROOT}/tools/bin" + System.IO.Path.PathSeparator +
Expand Down

0 comments on commit de8f42a

Please sign in to comment.