Skip to content

Commit 8ce006b

Browse files
committed
(build) added build arguments option
1 parent d1fdb2f commit 8ce006b

File tree

20 files changed

+82
-15
lines changed

20 files changed

+82
-15
lines changed

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ $Arguments = @{
4949
# Start Cake
5050
Write-Host "Running build stage $Stage..."
5151

52-
& dotnet run --project build/$Stage/$Stage.csproj -- $Arguments
52+
& dotnet run --project build/$Stage/$Stage.csproj -- $Arguments $ScriptArgs
5353

5454
if ($env:APPVEYOR) {
5555
$host.SetShouldExit($LASTEXITCODE)

build/artifacts/BuildLifetime.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ public class BuildLifetime : BuildLifetimeBase<BuildContext>
1212
public override void Setup(BuildContext context)
1313
{
1414
base.Setup(context);
15-
context.IsDockerOnLinux = context.DockerCustomCommand("info --format '{{.OSType}}'").First().Replace("'", "") == "linux";
15+
context.IsDockerOnLinux = context.DockerCustomCommand("info --format '{{.OSType}}'").First().Replace("'", string.Empty) == "linux";
1616

1717
var dockerRegistry = context.Argument(Arguments.DockerRegistry, "github").ToLower();
18-
var dotnetVersion = context.Argument(Arguments.DockerDotnetversion, string.Empty).ToLower();
18+
var dotnetVersion = context.Argument(Arguments.DockerDotnetVersion, string.Empty).ToLower();
1919
var dockerDistro = context.Argument(Arguments.DockerDistro, string.Empty).ToLower();
2020

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

build/artifacts/Tasks/Default.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
using Cake.Frosting;
2+
13
namespace Artifacts.Tasks
24
{
5+
[TaskDescription("Shows this output")]
36
public class Default : Common.Tasks.Default
47
{
58
}

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/Default.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
using Cake.Frosting;
2+
13
namespace Build.Tasks
24
{
5+
[TaskDescription("Shows this output")]
36
public class Default : Common.Tasks.Default
47
{
58
}

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("(CI only) Run the tests and publish the results.")]
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/PublishCoverage.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(PublishCoverage))]
10-
[TaskDescription("Publishes the test coverage.")]
10+
[TaskDescription("Publishes the test coverage")]
1111
[IsDependentOn(typeof(UnitTest))]
1212
public class PublishCoverage : FrostingTask<BuildContext>
1313
{

build/build/Tasks/Test/UnitTest.cs

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

build/build/Utilities/ContextExtensions.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ namespace Build.Utilities
77
{
88
public static class ContextExtensions
99
{
10-
public static FilePath? GetGitVersionToolLocation(this BuildContext context)
11-
{
12-
return context.GetFiles($"src/GitVersion.App/bin/{context.MsBuildConfiguration}/{Constants.NetVersion50}/gitversion.dll").SingleOrDefault();
13-
}
10+
public static FilePath? GetGitVersionToolLocation(this BuildContext context) =>
11+
context.GetFiles($"src/GitVersion.App/bin/{context.MsBuildConfiguration}/{Constants.NetVersion50}/gitversion.dll").SingleOrDefault();
1412
}
1513
}

0 commit comments

Comments
 (0)