1414using System . Collections . Generic ;
1515using System . IO ;
1616using System . Linq ;
17- using static Nuke . Common . IO . FileSystemTasks ;
18- using static Nuke . Common . IO . PathConstruction ;
1917using static Nuke . Common . Tools . DotNet . DotNetTasks ;
2018using static Nuke . Common . Tools . NuGet . NuGetTasks ;
2119using Project = Nuke . Common . ProjectModel . Project ;
@@ -99,7 +97,7 @@ protected override void OnBuildInitialized()
9997
10098 Log . Information ( "Building version: {Version}" , Version ) ;
10199
102- TargetProject = Solution . GetProject ( SourceDirectory / TargetProjectName / $ " { TargetLibName } .csproj" ) ;
100+ TargetProject = Solution . GetProject ( TargetLibName ) ;
103101 TargetProject . NotNull ( "TargetProject could not be loaded!" ) ;
104102
105103 TargetFrameworks = TargetProject . GetTargetFrameworks ( ) ;
@@ -112,7 +110,7 @@ protected override void OnBuildInitialized()
112110 . Before ( Restore )
113111 . Executes ( ( ) =>
114112 {
115- SourceDirectory . GlobDirectories ( "**/bin" , "**/obj" ) . ForEach ( DeleteDirectory ) ;
113+ SourceDirectory . GlobDirectories ( "**/bin" , "**/obj" ) . ForEach ( x => x . DeleteDirectory ( ) ) ;
116114 } ) ;
117115
118116 Target Restore => _ => _
@@ -152,14 +150,14 @@ protected override void OnBuildInitialized()
152150 var targetDir = NugetDirectory / "lib" / item ;
153151 var srcDir = BuildDirectory / item ;
154152
155- CopyFile ( srcDir / $ "{ TargetProjectName } .dll", targetDir / $ "{ TargetProjectName } .dll", FileExistsPolicy . OverwriteIfNewer ) ;
156- CopyFile ( srcDir / $ "{ TargetProjectName } .pdb", targetDir / $ "{ TargetProjectName } .pdb", FileExistsPolicy . OverwriteIfNewer ) ;
157- CopyFile ( srcDir / $ "{ TargetProjectName } .xml", targetDir / $ "{ TargetProjectName } .xml", FileExistsPolicy . OverwriteIfNewer ) ;
153+ ( srcDir / $ "{ TargetProjectName } .dll") . Copy ( targetDir / $ "{ TargetProjectName } .dll", ExistsPolicy . FileOverwriteIfNewer ) ;
154+ ( srcDir / $ "{ TargetProjectName } .pdb") . Copy ( targetDir / $ "{ TargetProjectName } .pdb", ExistsPolicy . FileOverwriteIfNewer ) ;
155+ ( srcDir / $ "{ TargetProjectName } .xml") . Copy ( targetDir / $ "{ TargetProjectName } .xml", ExistsPolicy . FileOverwriteIfNewer ) ;
158156 }
159157
160- CopyFile ( SourceDirectory / $ "{ TargetProjectName } .nuspec", NugetDirectory / $ "{ TargetProjectName } .nuspec", FileExistsPolicy . OverwriteIfNewer ) ;
161- CopyFile ( RootDirectory / "logo.png" , NugetDirectory / "logo.png" , FileExistsPolicy . OverwriteIfNewer ) ;
162- CopyFile ( RootDirectory / "README.md" , NugetDirectory / "README.md" , FileExistsPolicy . OverwriteIfNewer ) ;
158+ ( SourceDirectory / $ "{ TargetProjectName } .nuspec") . Copy ( NugetDirectory / $ "{ TargetProjectName } .nuspec", ExistsPolicy . FileOverwriteIfNewer ) ;
159+ ( RootDirectory / "logo.png" ) . Copy ( NugetDirectory / "logo.png" , ExistsPolicy . FileOverwriteIfNewer ) ;
160+ ( RootDirectory / "README.md" ) . Copy ( NugetDirectory / "README.md" , ExistsPolicy . FileOverwriteIfNewer ) ;
163161 } ) ;
164162
165163 Target CreatePackage => _ => _
@@ -191,7 +189,7 @@ protected override void OnBuildInitialized()
191189 throw new BuildAbortedException ( "Could not resolve the NuGet API key." ) ;
192190 }
193191
194- foreach ( var nupkg in GlobFiles ( NugetDirectory , "*.nupkg" ) )
192+ foreach ( var nupkg in NugetDirectory . GlobFiles ( "*.nupkg" ) )
195193 {
196194 NuGetPush ( s => s
197195 . SetTargetPath ( nupkg )
0 commit comments