Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up Build.cs #2093

Merged
merged 16 commits into from Jan 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions Build/Build.cs
Expand Up @@ -115,7 +115,7 @@ class Build : NukeBuild
{
DotNetBuild(s => s
.SetProjectFile(Solution)
.SetConfiguration("CI")
IT-VBFK marked this conversation as resolved.
Show resolved Hide resolved
.SetConfiguration(Configuration.CI)
.EnableNoLogo()
.EnableNoRestore()
.SetAssemblyVersion(GitVersion.AssemblySemVer)
Expand All @@ -129,7 +129,7 @@ class Build : NukeBuild
.Executes(() =>
{
DotNetTest(s => s
.SetConfiguration("Release")
.SetConfiguration(Configuration.Release)
.SetProcessEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en-US")
.EnableNoBuild()
.CombineWith(
Expand Down Expand Up @@ -166,7 +166,7 @@ class Build : NukeBuild
.Executes(() =>
{
DotNetTest(s => s
.SetConfiguration("Debug")
.SetConfiguration(Configuration.Debug)
.SetProcessEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en-US")
.EnableNoBuild()
.SetDataCollector("XPlat Code Coverage")
Expand Down Expand Up @@ -229,7 +229,7 @@ class Build : NukeBuild
select new { project, framework };

DotNetTest(s => s
.SetConfiguration("Debug")
.SetConfiguration(Configuration.Debug)
.SetProcessEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en-US")
.EnableNoBuild()
.SetDataCollector("XPlat Code Coverage")
Expand Down Expand Up @@ -259,7 +259,7 @@ class Build : NukeBuild
DotNetPack(s => s
.SetProject(Solution.Core.FluentAssertions)
.SetOutputDirectory(ArtifactsDirectory)
.SetConfiguration("Release")
.SetConfiguration(Configuration.Release)
.EnableNoLogo()
.EnableNoRestore()
.EnableContinuousIntegrationBuild() // Necessary for deterministic builds
Expand Down
15 changes: 15 additions & 0 deletions Build/Configuration.cs
@@ -0,0 +1,15 @@
using System.ComponentModel;
using Nuke.Common.Tooling;

[TypeConverter(typeof(TypeConverter<Configuration>))]
public class Configuration : Enumeration
{
public static Configuration Debug = new Configuration { Value = nameof(Debug) };
public static Configuration Release = new Configuration { Value = nameof(Release) };
public static Configuration CI = new Configuration { Value = nameof(CI) };

public static implicit operator string(Configuration configuration)
{
return configuration.Value;
}
}