diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/Builders/DotNetBuildTaskBuilder.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/Builders/DotNetBuildTaskBuilder.cs index fcae94a..0cfe25f 100644 --- a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/Builders/DotNetBuildTaskBuilder.cs +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/Builders/DotNetBuildTaskBuilder.cs @@ -12,7 +12,7 @@ public class DotNetBuildTaskBuilder public DotNetBuildTaskBuilder() { - dotnetBuildTask = new DotNetBuildTask + this.dotnetBuildTask = new DotNetBuildTask { Run = "dotnet build" }; @@ -20,22 +20,24 @@ public DotNetBuildTaskBuilder() public DotNetBuildTaskBuilder WithName(string name) { - dotnetBuildTask.Name = name; + this.dotnetBuildTask.Name = name; return this; } public DotNetBuildTaskBuilder WithRestore(bool restore = true) { - dotnetBuildTask.Restore = restore; + this.dotnetBuildTask.Restore = restore; return this; } public DotNetBuildTask Build() { - if (!dotnetBuildTask.Restore) - dotnetBuildTask.Run += " --no-restore"; + if (this.dotnetBuildTask.Restore is false) + { + this.dotnetBuildTask.Run += " --no-restore"; + } - return dotnetBuildTask; + return this.dotnetBuildTask; } } } diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/Builders/NuGetPushTaskBuilder.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/Builders/NuGetPushTaskBuilder.cs index 41b03f4..5b883d7 100644 --- a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/Builders/NuGetPushTaskBuilder.cs +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/Builders/NuGetPushTaskBuilder.cs @@ -12,45 +12,55 @@ public class NuGetPushTaskBuilder public NuGetPushTaskBuilder() { - nugetPushTask = new NuGetPushTask(); + this.nugetPushTask = new NuGetPushTask(); } public NuGetPushTaskBuilder WithName(string name) { - nugetPushTask.Name = name; + this.nugetPushTask.Name = name; + return this; } public NuGetPushTaskBuilder WithSearchPath(string searchPath) { - nugetPushTask.SearchPath = searchPath; + this.nugetPushTask.SearchPath = searchPath; + return this; } public NuGetPushTaskBuilder WithApiKey(string apiKey) { - nugetPushTask.ApiKey = apiKey; + this.nugetPushTask.ApiKey = apiKey; + return this; } public NuGetPushTaskBuilder WithDestination(string destination) { - nugetPushTask.Destination = destination; + this.nugetPushTask.Destination = destination; + return this; } public NuGetPushTask Build() { - if (!string.IsNullOrEmpty(nugetPushTask.SearchPath)) - nugetPushTask.Run += $" \"{nugetPushTask.SearchPath}\""; + if (!string.IsNullOrEmpty(this.nugetPushTask.SearchPath)) + { + this.nugetPushTask.Run += $" \"{this.nugetPushTask.SearchPath}\""; + } - if (!string.IsNullOrEmpty(nugetPushTask.ApiKey)) - nugetPushTask.Run += $" --api-key {nugetPushTask.ApiKey}"; + if (!string.IsNullOrEmpty(this.nugetPushTask.ApiKey)) + { + this.nugetPushTask.Run += $" --api-key {this.nugetPushTask.ApiKey}"; + } - if (!string.IsNullOrEmpty(nugetPushTask.Destination)) - nugetPushTask.Run += $" --source \"{nugetPushTask.Destination}\""; + if (!string.IsNullOrEmpty(this.nugetPushTask.Destination)) + { + this.nugetPushTask.Run += $" --source \"{this.nugetPushTask.Destination}\""; + } - return nugetPushTask; + return this.nugetPushTask; } } } diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/NuGetPushTask.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/NuGetPushTask.cs index 344579f..43f8607 100644 --- a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/NuGetPushTask.cs +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/NuGetPushTask.cs @@ -14,9 +14,7 @@ public class NuGetPushTask : GithubTask public string Run = "dotnet nuget push"; internal string SearchPath { get; set; } - internal string ApiKey { get; set; } - internal string Destination { get; set; } } }