|
1 | | -// Copyright 2018 Maintainers of NUKE. |
| 1 | +// Copyright 2018 Maintainers of NUKE. |
2 | 2 | // Distributed under the MIT License. |
3 | 3 | // https://github.com/nuke-build/nuke/blob/master/LICENSE |
4 | 4 |
|
|
24 | 24 | using static Nuke.Common.Tools.InspectCode.InspectCodeTasks; |
25 | 25 | using static Nuke.Common.IO.FileSystemTasks; |
26 | 26 | using static Nuke.Common.IO.PathConstruction; |
27 | | -using static Nuke.Common.EnvironmentInfo; |
28 | 27 | using static Nuke.Common.Tools.Slack.SlackTasks; |
29 | 28 |
|
30 | 29 | // ReSharper disable HeapView.DelegateAllocation |
31 | 30 |
|
| 31 | +// [DotNetVerbosityMapping] |
32 | 32 | partial class Build : NukeBuild |
33 | 33 | { |
34 | 34 | public static int Main() => Execute<Build>(x => x.Pack); |
@@ -59,7 +59,7 @@ partial class Build : NukeBuild |
59 | 59 | .Before(Restore) |
60 | 60 | .Executes(() => |
61 | 61 | { |
62 | | - DeleteDirectories(GlobDirectories(SourceDirectory, "*/bin", "*/obj")); |
| 62 | + SourceDirectory.GlobDirectories("*/bin", "*/obj").ForEach(DeleteDirectory); |
63 | 63 | EnsureCleanDirectory(OutputDirectory); |
64 | 64 | }); |
65 | 65 |
|
@@ -131,13 +131,14 @@ from framework in project.GetMSBuildProject().GetTargetFrameworks() |
131 | 131 | .DependsOn(Compile) |
132 | 132 | .Executes(() => |
133 | 133 | { |
134 | | - Solution.GetProjects("*.Tests") |
135 | | - .ForEach(x => DotNetTest(s => s |
136 | | - .SetProjectFile(x) |
137 | | - .SetConfiguration(Configuration) |
138 | | - .EnableNoBuild() |
139 | | - .SetLogger("trx") |
140 | | - .SetResultsDirectory(OutputDirectory))); |
| 134 | + DotNetTest(s => s |
| 135 | + .SetConfiguration(Configuration) |
| 136 | + .EnableNoBuild() |
| 137 | + .SetLogger("trx") |
| 138 | + .SetResultsDirectory(OutputDirectory) |
| 139 | + .CombineWith( |
| 140 | + Solution.GetProjects("*.Tests"), (cs, v) => cs |
| 141 | + .SetProjectFile(v))); |
141 | 142 | }); |
142 | 143 |
|
143 | 144 | Target Analysis => _ => _ |
@@ -166,13 +167,15 @@ from framework in project.GetMSBuildProject().GetTargetFrameworks() |
166 | 167 | GitRepository.Branch.StartsWithOrdinalIgnoreCase(HotfixBranchPrefix)) |
167 | 168 | .Executes(() => |
168 | 169 | { |
169 | | - GlobFiles(OutputDirectory, "*.nupkg").NotEmpty() |
170 | | - .Where(x => !x.EndsWith(".symbols.nupkg")) |
171 | | - .ForEach(x => DotNetNuGetPush(s => s |
172 | | - .SetTargetPath(x) |
| 170 | + DotNetNuGetPush(s => s |
173 | 171 | .SetSource(Source) |
174 | 172 | .SetSymbolSource(SymbolSource) |
175 | | - .SetApiKey(ApiKey))); |
| 173 | + .SetApiKey(ApiKey) |
| 174 | + .CombineWith( |
| 175 | + OutputDirectory.GlobFiles("*.nupkg").NotEmpty(), (cs, v) => cs |
| 176 | + .SetTargetPath(v)), |
| 177 | + degreeOfParallelism: 5, |
| 178 | + completeOnFailure: true); |
176 | 179 |
|
177 | 180 | if (GitRepository.Branch.EqualsOrdinalIgnoreCase(MasterBranch)) |
178 | 181 | { |
|
0 commit comments