Skip to content

Commit d1fdb2f

Browse files
committed
(build) moved arguments names to Arguments.cs
1 parent 935cd6c commit d1fdb2f

File tree

8 files changed

+20
-17
lines changed

8 files changed

+20
-17
lines changed

build/artifacts/BuildLifetime.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public override void Setup(BuildContext context)
1414
base.Setup(context);
1515
context.IsDockerOnLinux = context.DockerCustomCommand("info --format '{{.OSType}}'").First().Replace("'", "") == "linux";
1616

17-
var dockerRegistry = context.Argument("docker_registry", "github").ToLower();
18-
var dotnetVersion = context.Argument("docker_dotnetversion", "").ToLower();
19-
var dockerDistro = context.Argument("docker_distro", "").ToLower();
17+
var dockerRegistry = context.Argument(Arguments.DockerRegistry, "github").ToLower();
18+
var dotnetVersion = context.Argument(Arguments.DockerDotnetversion, string.Empty).ToLower();
19+
var dockerDistro = context.Argument(Arguments.DockerDistro, string.Empty).ToLower();
2020

2121
var versions = string.IsNullOrWhiteSpace(dotnetVersion) ? Constants.VersionsToBuild : new[] { dotnetVersion };
2222
var distros = string.IsNullOrWhiteSpace(dockerDistro) ? Constants.DockerDistrosToBuild : new[] { dockerDistro };

build/build/Tasks/Build.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Build.Tasks
88
{
99
[TaskName(nameof(Build))]
10-
[TaskDescription("Builds the solution")]
10+
[TaskDescription("Builds the solution.")]
1111
[IsDependentOn(typeof(Clean))]
1212
[IsDependentOn(typeof(CodeFormat))]
1313
public sealed class Build : FrostingTask<BuildContext>

build/build/Tasks/Clean.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace Build.Tasks
77
{
88
[TaskName(nameof(Clean))]
9-
[TaskDescription("Cleans build artifacts")]
9+
[TaskDescription("Cleans build artifacts.")]
1010
public sealed class Clean : FrostingTask<BuildContext>
1111
{
1212
public override void Run(BuildContext context)

build/build/Tasks/Test.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Build.Tasks
44
{
55
[TaskName(nameof(Test))]
6-
[TaskDescription("Run the tests. Can be specified the target framework with --dotnet_target=")]
6+
[TaskDescription("(CI only) Run the tests and publish the results.")]
77
[IsDependentOn(typeof(PublishCoverage))]
88
public class Test : FrostingTask<BuildContext>
99
{

build/build/Tasks/Test/UnitTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace Build.Tasks
1818
{
1919
[TaskName(nameof(UnitTest))]
20-
[TaskDescription("Run the unit tests. Can be specified the target framework with --dotnet_target=")]
20+
[TaskDescription("Run the tests. Can be specified the target framework with --dotnet_target={target} where target is net5.0, net48 or netcoreapp3.1")]
2121
[IsDependentOn(typeof(Build))]
2222
public class UnitTest : FrostingTask<BuildContext>
2323
{

build/build/Utilities/Arguments.cs

Lines changed: 0 additions & 8 deletions
This file was deleted.

build/common/Utilities/Arguments.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace Common.Utilities
2+
{
3+
public class Arguments
4+
{
5+
public const string Configuration = "configuration";
6+
public const string DotnetTarget = "dotnet_target";
7+
public const string DockerRegistry = "docker_registry";
8+
public const string DockerDotnetversion = "docker_dotnetversion";
9+
public const string DockerDistro = "docker_distro";
10+
}
11+
}

build/docker/BuildLifetime.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public override void Setup(BuildContext context)
1515

1616
context.IsDockerOnLinux = context.DockerCustomCommand("info --format '{{.OSType}}'").First().Replace("'", "") == "linux";
1717

18-
var dotnetVersion = context.Argument("docker_dotnetversion", "").ToLower();
19-
var dockerDistro = context.Argument("docker_distro", "").ToLower();
18+
var dotnetVersion = context.Argument(Arguments.DockerDotnetversion, string.Empty).ToLower();
19+
var dockerDistro = context.Argument(Arguments.DockerDistro, string.Empty).ToLower();
2020

2121
var versions = string.IsNullOrWhiteSpace(dotnetVersion) ? Constants.VersionsToBuild : new[] { dotnetVersion };
2222
var distros = string.IsNullOrWhiteSpace(dockerDistro) ? Constants.DockerDistrosToBuild : new[] { dockerDistro };

0 commit comments

Comments
 (0)