diff --git a/.github/workflows/sdl2.yml b/.github/workflows/sdl2.yml index f1d143cee2..3e611de61f 100644 --- a/.github/workflows/sdl2.yml +++ b/.github/workflows/sdl2.yml @@ -148,7 +148,7 @@ jobs: - name: Build SDL2 if: runner.os != 'Linux' - run: ${{ matrix.env.nuke_invoke }} SDL2 ${{ runner.os == 'Windows' && format('{0} {1}', '--native --android-sdk-value', env.ANDROID_HOME) || '' }} + run: ${{ matrix.env.nuke_invoke }} SDL2 ${{ runner.os == 'Windows' && format('{0} {1}', '--native --android-sdk-override', env.ANDROID_HOME) || '' }} env: PUSHABLE_GITHUB_TOKEN: ${{ secrets.PUSHABLE_GITHUB_TOKEN }} diff --git a/build/nuke/Native/Core.cs b/build/nuke/Native/Core.cs index f5a0669815..052c2411a2 100644 --- a/build/nuke/Native/Core.cs +++ b/build/nuke/Native/Core.cs @@ -29,7 +29,9 @@ partial class Build { [Nuke.Common.Parameter("Build native code")] readonly bool Native; - [Nuke.Common.Parameter("Android home. Will be determined from dotnet if not provided.")] [CanBeNull] string AndroidHomeValue; + [CanBeNull] string AndroidHomeValue; + + [Nuke.Common.Parameter("Android home. Will be determined from dotnet if not provided.")] readonly string AndroidHomeOverride; static string JobsArg => string.IsNullOrWhiteSpace(GitHubActions.Instance?.Job) ? $" -j{Jobs}" diff --git a/build/nuke/Native/SilkDroid.cs b/build/nuke/Native/SilkDroid.cs index f78ca2847b..6ec9951a93 100644 --- a/build/nuke/Native/SilkDroid.cs +++ b/build/nuke/Native/SilkDroid.cs @@ -36,6 +36,12 @@ string AndroidHome return AndroidHomeValue; } + if (AndroidHomeOverride is not null) + { + AndroidHomeValue = AndroidHomeOverride; + return AndroidHomeValue; + } + var utils = RootDirectory / "build" / "utilities"; DotNet($"build \"{utils / "android_probe.proj"}\" /t:GetAndroidJar"); AndroidHomeValue = (AbsolutePath) File.ReadAllText(utils / "android.jar.gen.txt") / ".." / ".." / "..";