Skip to content

Commit

Permalink
More respect env var changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Perksey authored Jun 6, 2024
1 parent bb2346d commit 0394a77
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build/nuke/Native/SilkDroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ string AndroidHome
return AndroidHomeValue;
}

if ((Environment.GetEnvironmentVariable("ANDROID_HOME") ?? Environment.GetEnvironmentVariable("ANDROID_SDK_ROOT")) is {} sdk)
{
AndroidHomeOverride = sdk;

Check failure on line 47 in build/nuke/Native/SilkDroid.cs

View workflow job for this annotation

GitHub Actions / Windows Build

A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer)

Check failure on line 47 in build/nuke/Native/SilkDroid.cs

View workflow job for this annotation

GitHub Actions / Build

A readonly field cannot be assigned to (except in a constructor or init-only setter of the type in which the field is defined or a variable initializer)
return sdk;
}

var utils = RootDirectory / "build" / "utilities";
DotNet($"build \"{utils / "android_probe.proj"}\" /t:GetAndroidJar");
AndroidHomeValue = (AbsolutePath) File.ReadAllText(utils / "android.jar.gen.txt") / ".." / ".." / "..";
Expand Down Expand Up @@ -86,6 +92,7 @@ string AndroidHome

var envVars = CreateEnvVarDictionary();
envVars["ANDROID_HOME"] = AndroidHome;
envVars["ANDROID_SDK_ROOT"] = AndroidHome;

foreach (var ndk in Directory.GetDirectories((AbsolutePath) AndroidHome / "ndk")
.OrderByDescending(x => Version.Parse(Path.GetFileName(x))))
Expand Down

0 comments on commit 0394a77

Please sign in to comment.