1616using System . Linq ;
1717using Nuke . Common . Tooling ;
1818using static Nuke . Common . IO . FileSystemTasks ;
19- using static Nuke . Common . IO . PathConstruction ;
2019using static Nuke . Common . Tools . DotNet . DotNetTasks ;
2120using static Nuke . Common . Tools . NuGet . NuGetTasks ;
2221using Project = Nuke . Common . ProjectModel . Project ;
@@ -100,7 +99,7 @@ protected override void OnBuildInitialized()
10099
101100 Log . Information ( "Building version: {Version}" , Version ) ;
102101
103- TargetProject = Solution . GetProject ( SourceDirectory / TargetProjectName / $ " { TargetLibName } .csproj" ) ;
102+ TargetProject = Solution . GetProject ( TargetLibName ) ;
104103 TargetProject . NotNull ( "TargetProject could not be loaded!" ) ;
105104
106105 TargetFrameworks = TargetProject . GetTargetFrameworks ( ) ;
@@ -113,7 +112,7 @@ protected override void OnBuildInitialized()
113112 . Before ( Restore )
114113 . Executes ( ( ) =>
115114 {
116- SourceDirectory . GlobDirectories ( "**/bin" , "**/obj" ) . ForEach ( DeleteDirectory ) ;
115+ SourceDirectory . GlobDirectories ( "**/bin" , "**/obj" ) . ForEach ( x => x . DeleteDirectory ( ) ) ;
117116 } ) ;
118117
119118 Target Restore => _ => _
@@ -130,6 +129,7 @@ protected override void OnBuildInitialized()
130129 DotNetBuild ( s => s
131130 . SetProjectFile ( Solution )
132131 . SetConfiguration ( Configuration )
132+ . SetContinuousIntegrationBuild ( IsServerBuild )
133133 . EnableNoRestore ( ) ) ;
134134 } ) ;
135135
@@ -143,6 +143,7 @@ protected override void OnBuildInitialized()
143143 . EnableNoRestore ( )
144144 . EnableNoBuild ( )
145145 . SetProcessEnvironmentVariable ( "prefetched" , "false" )
146+ . When ( GitHubActions . Instance is not null , x => x . SetLoggers ( "GitHubActions" ) )
146147 ) ;
147148
148149 DotNetTest ( s => s
@@ -151,6 +152,7 @@ protected override void OnBuildInitialized()
151152 . EnableNoRestore ( )
152153 . EnableNoBuild ( )
153154 . SetProcessEnvironmentVariable ( "prefetched" , "true" )
155+ . When ( GitHubActions . Instance is not null , x => x . SetLoggers ( "GitHubActions" ) )
154156 ) ;
155157 } ) ;
156158
@@ -183,9 +185,9 @@ protected override void OnBuildInitialized()
183185 . SetTargetPath ( nuspec )
184186 . SetVersion ( Version )
185187 . SetOutputDirectory ( NugetDirectory )
186- . SetSymbols ( true )
187- . SetSymbolPackageFormat ( " snupkg" )
188- . AddProperty ( "Configuration" , Configuration )
188+ . EnableSymbols ( )
189+ . SetSymbolPackageFormat ( NuGetSymbolPackageFormat . snupkg )
190+ . SetConfiguration ( Configuration )
189191 ) ;
190192 } ) ;
191193
@@ -202,7 +204,7 @@ protected override void OnBuildInitialized()
202204 throw new BuildAbortedException ( "Could not resolve the NuGet API key." ) ;
203205 }
204206
205- foreach ( var nupkg in GlobFiles ( NugetDirectory , "*.nupkg" ) )
207+ foreach ( var nupkg in NugetDirectory . GlobFiles ( "*.nupkg" ) )
206208 {
207209 NuGetPush ( s => s
208210 . SetTargetPath ( nupkg )
0 commit comments