Skip to content

Commit

Permalink
Atempt to fix override logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Perksey authored Jun 6, 2024
1 parent 548fd51 commit a2ef5ff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sdl2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

4 changes: 3 additions & 1 deletion build/nuke/Native/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
6 changes: 6 additions & 0 deletions build/nuke/Native/SilkDroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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") / ".." / ".." / "..";
Expand Down

0 comments on commit a2ef5ff

Please sign in to comment.