|
1 | 1 | using Nuke.Common; |
2 | 2 | using Nuke.Common.CI; |
3 | 3 | using Nuke.Common.CI.GitHubActions; |
4 | | -using Nuke.Common.Execution; |
5 | 4 | using Nuke.Common.IO; |
6 | 5 | using Nuke.Common.ProjectModel; |
7 | 6 | using Nuke.Common.Tooling; |
8 | 7 | using Nuke.Common.Tools.DotNet; |
9 | 8 | using Nuke.Common.Utilities.Collections; |
10 | 9 | using static Nuke.Common.EnvironmentInfo; |
11 | | -using static Nuke.Common.IO.FileSystemTasks; |
12 | | -using static Nuke.Common.IO.PathConstruction; |
13 | 10 | using static Nuke.Common.Tools.DotNet.DotNetTasks; |
14 | 11 |
|
15 | 12 | [ShutdownDotNetAfterServerBuild] |
@@ -37,16 +34,16 @@ class Build : NukeBuild |
37 | 34 | [Parameter] readonly AbsolutePath PackagesDirectory = RootDirectory / "packages"; |
38 | 35 |
|
39 | 36 | const string NugetOrgUrl = "https://api.nuget.org/v3/index.json"; |
40 | | - bool IsTag => GitHubActions.Instance?.GitHubRef?.StartsWith("refs/tags/") ?? false; |
| 37 | + bool IsTag => GitHubActions.Instance?.Ref?.StartsWith("refs/tags/") ?? false; |
41 | 38 |
|
42 | 39 | Target Clean => _ => _ |
43 | 40 | .Before(Restore) |
44 | 41 | .Executes(() => |
45 | 42 | { |
46 | | - SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory); |
47 | | - TestsDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory); |
48 | | - EnsureCleanDirectory(PackagesDirectory); |
49 | | - EnsureCleanDirectory(ArtifactsDirectory); |
| 43 | + SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory()); |
| 44 | + TestsDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory()); |
| 45 | + PackagesDirectory.CreateOrCleanDirectory(); |
| 46 | + ArtifactsDirectory.CreateOrCleanDirectory(); |
50 | 47 | }); |
51 | 48 |
|
52 | 49 | Target Restore => _ => _ |
@@ -108,8 +105,8 @@ class Build : NukeBuild |
108 | 105 |
|
109 | 106 | if (!string.IsNullOrEmpty(PackagesDirectory)) |
110 | 107 | { |
111 | | - DeleteDirectory(PackagesDirectory / "stronglytypedid"); |
112 | | - DeleteDirectory(PackagesDirectory / "stronglytypedid.attributes"); |
| 108 | + (PackagesDirectory / "stronglytypedid").DeleteDirectory(); |
| 109 | + (PackagesDirectory / "stronglytypedid.attributes").DeleteDirectory(); |
113 | 110 | } |
114 | 111 |
|
115 | 112 | DotNetRestore(s => s |
|
0 commit comments