Skip to content

Commit

Permalink
Fixed mac build
Browse files Browse the repository at this point in the history
  • Loading branch information
veler committed Apr 7, 2024
1 parent 56f2e1a commit 5c98405
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
- name: 'Run: RunTests'
run: ./build.cmd RunTests
macos-latest:
name: macos-latest
runs-on: macos-latest
name: macos-14
runs-on: macos-14
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 0 additions & 2 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
"Compile",
"CompileGenerators",
"GenerateSdkNuGet",
"PreliminaryCheck",
"PublishApp",
"Restore",
"RunTests",
Expand All @@ -102,7 +101,6 @@
"Compile",
"CompileGenerators",
"GenerateSdkNuGet",
"PreliminaryCheck",
"PublishApp",
"Restore",
"RunTests",
Expand Down
25 changes: 3 additions & 22 deletions src/build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using static RestoreTask;
using Project = Nuke.Common.ProjectModel.Project;

#pragma warning disable IDE1006 // Naming Styles
[GitHubActions(
name: "ci",
GitHubActionsImage.WindowsLatest,
Expand Down Expand Up @@ -49,30 +48,13 @@ class Build : NukeBuild
[Solution(SuppressBuildProjectCheck = true)]
readonly Solution? LinuxSolution;

Target PreliminaryCheck => _ => _
.Before(Clean)
.Executes(() =>
{
if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 0, 0))
{
Assert.Fail("To build Windows app, you need to run on Windows 10 or later.");
return;
}
Log.Information("Preliminary checks are successful.");
});

Target Clean => _ => _
.DependsOn(PreliminaryCheck)
.Executes(() =>
{
if (!Debugger.IsAttached)
{
RootDirectory
RootDirectory
.GlobDirectories("bin", "obj", "packages", "publish")
.ForEach(path => path.CreateOrCleanDirectory());
Log.Information("Cleaned bin, obj, packages and publish folders.");
}
Log.Information("Cleaned bin, obj, packages and publish folders.");
});

Target Restore => _ => _
Expand Down Expand Up @@ -134,7 +116,7 @@ class Build : NukeBuild
}
DotNetBuild(s => s
.SetProjectFile(solution.Path)
.SetProjectFile(solution)
.SetConfiguration(Configuration)
.SetVerbosity(DotNetVerbosity.quiet));
});
Expand Down Expand Up @@ -403,5 +385,4 @@ IEnumerable<DotnetParameters> GetDotnetParametersForMacOSApp()
throw new NotSupportedException();
}
}
#pragma warning restore IDE1006 // Naming Styles
}
3 changes: 2 additions & 1 deletion src/build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
<OutputType>Exe</OutputType>
<TargetFramework>$(NetCore)</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NoWarn>CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006</NoWarn>
<NukeRootDirectory>..\..</NukeRootDirectory>
<NukeScriptDirectory>..\..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<IsPackable>false</IsPackable>
<EnableCentralBuildOutput>false</EnableCentralBuildOutput>
</PropertyGroup>

Expand Down

0 comments on commit 5c98405

Please sign in to comment.