diff --git a/build.cake b/build.cake index 092334b9f8..3d2dfe6e51 100644 --- a/build.cake +++ b/build.cake @@ -111,7 +111,7 @@ Task("Clean-Impl") Task("Restore-NuGet-Packages-Impl") .WithCriteria((context, data) => data.Parameters.IsRunningOnWindows) - .WithCriteria((context, data) => data.Parameters.Platform != "NetCoreOnly") + .WithCriteria((context, data) => !data.Parameters.IsPlatformNetCoreOnly) .Does(data => { var maxRetryCount = 5; @@ -152,7 +152,7 @@ void DotNetCoreBuild(Parameters parameters) Task("Build-Impl") .Does(data => { - if(data.Parameters.IsRunningOnWindows && data.Parameters.Platform != "NetCoreOnly") + if(data.Parameters.IsRunningOnWindows && !data.Parameters.IsPlatformNetCoreOnly) { MSBuild(data.Parameters.MSBuildSolution, settings => { settings.SetConfiguration(data.Parameters.Configuration); @@ -207,7 +207,7 @@ Task("Run-Unit-Tests-Impl") RunCoreTest("./tests/Avalonia.Styling.UnitTests", data.Parameters, false); RunCoreTest("./tests/Avalonia.Visuals.UnitTests", data.Parameters, false); RunCoreTest("./tests/Avalonia.Skia.UnitTests", data.Parameters, false); - if (data.Parameters.IsRunningOnWindows && data.Parameters.Platform != "NetCoreOnly") + if (data.Parameters.IsRunningOnWindows && !data.Parameters.IsPlatformNetCoreOnly) { RunCoreTest("./tests/Avalonia.Direct2D1.UnitTests", data.Parameters, true); } @@ -222,7 +222,7 @@ Task("Run-Designer-Tests-Impl") Task("Run-Render-Tests-Impl") .WithCriteria((context, data) => !data.Parameters.SkipTests && data.Parameters.IsRunningOnWindows) - .WithCriteria((context, data) => data.Parameters.Platform != "NetCoreOnly") + .WithCriteria((context, data) => !data.Parameters.IsPlatformNetCoreOnly) .Does(data => { RunCoreTest("./tests/Avalonia.Skia.RenderTests/Avalonia.Skia.RenderTests.csproj", data.Parameters, true); @@ -231,7 +231,7 @@ Task("Run-Render-Tests-Impl") Task("Run-Leak-Tests-Impl") .WithCriteria((context, data) => !data.Parameters.SkipTests && data.Parameters.IsRunningOnWindows) - .WithCriteria((context, data) => data.Parameters.Platform != "NetCoreOnly") + .WithCriteria((context, data) => !data.Parameters.IsPlatformNetCoreOnly) .Does(() => { var dotMemoryUnit = Context.Tools.Resolve("dotMemoryUnit.exe"); @@ -264,7 +264,7 @@ Task("Zip-Files-Impl") Zip(data.Parameters.NugetRoot, data.Parameters.ZipNuGetArtifacts); - if (data.Parameters.Platform != "NetCoreOnly") { + if (!data.Parameters.IsPlatformNetCoreOnly) { Zip(data.Parameters.ZipSourceControlCatalogDesktopDirs, data.Parameters.ZipTargetControlCatalogDesktopDirs, GetFiles(data.Parameters.ZipSourceControlCatalogDesktopDirs.FullPath + "/*.dll") + @@ -351,7 +351,7 @@ Task("Publish-NuGet-Impl") Task("Inspect-Impl") .WithCriteria((context, data) => data.Parameters.IsRunningOnWindows) - .WithCriteria((context, data) => data.Parameters.Platform != "NetCoreOnly") + .WithCriteria((context, data) => !data.Parameters.IsPlatformNetCoreOnly) .Does(() => { var badIssues = new []{"PossibleNullReferenceException"}; diff --git a/parameters.cake b/parameters.cake index 328eed81cf..e595b8159f 100644 --- a/parameters.cake +++ b/parameters.cake @@ -12,6 +12,7 @@ public class Parameters public bool IsPlatformAnyCPU { get; private set; } public bool IsPlatformX86 { get; private set; } public bool IsPlatformX64 { get; private set; } + public bool IsPlatformNetCoreOnly { get; private set; } public bool IsLocalBuild { get; private set; } public bool IsRunningOnUnix { get; private set; } public bool IsRunningOnWindows { get; private set; } @@ -58,6 +59,7 @@ public class Parameters IsPlatformAnyCPU = StringComparer.OrdinalIgnoreCase.Equals(Platform, "Any CPU"); IsPlatformX86 = StringComparer.OrdinalIgnoreCase.Equals(Platform, "x86"); IsPlatformX64 = StringComparer.OrdinalIgnoreCase.Equals(Platform, "x64"); + IsPlatformNetCoreOnly = StringComparer.OrdinalIgnoreCase.Equals(Platform, "NetCoreOnly"); IsLocalBuild = buildSystem.IsLocalBuild; IsRunningOnUnix = context.IsRunningOnUnix(); IsRunningOnWindows = context.IsRunningOnWindows();