@@ -50,32 +50,26 @@ partial class Build : NukeBuild
5050 [ Solution ] readonly Solution Solution ;
5151 [ GitRepository ] readonly GitRepository GitRepository ;
5252 [ GitVersion ] readonly GitVersion GitVersion ;
53-
54- [ Parameter ( "Makes the build deterministic when packaging assemblies" ) ] readonly bool Deterministic ;
55- [ Parameter ( "Sets the continuous integration build flag" ) ] readonly bool CI ;
56-
57- [ Secret ]
58- [ Parameter ( "NuGet API Key (secret)" , Name = Secrets . NuGetApiKey ) ]
59- readonly string NuGetApiKey ;
60-
61- readonly string NuGetSource = "https://api.nuget.org/v3/index.json" ;
62-
6353 [ CI ] readonly GitHubActions GitHubActions ;
6454
6555 [ Parameter ( "GitHub auth token" , Name = "github-token" ) , Secret ] readonly string GitHubToken ;
56+ [ Parameter ( "Forces the continuous integration build flag" ) ] readonly bool CI ;
6657
67- IEnumerable < Project > Excluded => new [ ]
58+ [ Secret ] [ Parameter ( "NuGet API Key (secret)" , Name = Secrets . NuGetApiKey ) ] readonly string NuGetApiKey ;
59+ readonly string NuGetSource = "https://api.nuget.org/v3/index.json" ;
60+
61+ IEnumerable < Project > Excluded => new [ ]
6862 {
6963 Solution . GetProject ( "_build" ) ,
7064 Solution . GetProject ( "TestTypeFoundation" )
7165 } ;
66+
7267 IEnumerable < Project > TestProjects => Solution . GetProjects ( "*Test" ) ;
7368 IEnumerable < Project > Libraries => Solution . Projects . Except ( TestProjects ) . Except ( Excluded ) ;
7469 IEnumerable < Project > CSharpLibraries => Libraries . Where ( x => x . Is ( ProjectType . CSharpProject ) ) ;
7570 IEnumerable < Project > FSharpLibraries => Libraries . Where ( x => x . Path . ToString ( ) . EndsWith ( ".fsproj" ) ) ;
7671 IEnumerable < AbsolutePath > Packages => PackagesDirectory . GlobFiles ( "*.nupkg" ) ;
7772
78- bool IsDeterministic => IsServerBuild || Deterministic ;
7973 bool IsContinuousIntegration => IsServerBuild || CI ;
8074
8175 AbsolutePath SourceDirectory => RootDirectory / "src" ;
@@ -111,7 +105,7 @@ partial class Build : NukeBuild
111105 {
112106 DotNetBuild ( s => s
113107 . SetProjectFile ( Solution )
114- . SetConfiguration ( " Verify" )
108+ . SetConfiguration ( Configuration . Verify )
115109 . SetNoRestore ( FinishedTargets . Contains ( Restore ) )
116110 . SetContinuousIntegrationBuild ( IsContinuousIntegration )
117111 . SetProcessArgumentConfigurator ( a => a
@@ -125,12 +119,14 @@ partial class Build : NukeBuild
125119 DotNetBuild ( s => s
126120 . SetProjectFile ( Solution )
127121 . SetConfiguration ( Configuration )
122+ . SetDeterministic ( IsContinuousIntegration )
123+ . SetContinuousIntegrationBuild ( IsContinuousIntegration )
124+ . SetSymbolPackageFormat ( DotNetSymbolPackageFormat . snupkg )
128125 . SetVersion ( GitVersion . NuGetVersionV2 )
129126 . SetAssemblyVersion ( GitVersion . AssemblySemVer )
130127 . SetFileVersion ( GitVersion . AssemblySemFileVer )
131128 . SetInformationalVersion ( GitVersion . InformationalVersion )
132129 . SetNoRestore ( FinishedTargets . Contains ( Restore ) )
133- . SetContinuousIntegrationBuild ( IsContinuousIntegration )
134130 . SetProcessArgumentConfigurator ( a => a
135131 . Add ( "/p:CheckEolTargetFramework=false" ) ) ) ;
136132 } ) ;
@@ -181,15 +177,17 @@ partial class Build : NukeBuild
181177 . Executes ( ( ) =>
182178 {
183179 DotNetPack ( s => s
180+ . SetConfiguration ( Configuration )
181+ . SetNoBuild ( FinishedTargets . Contains ( Compile ) )
184182 . SetOutputDirectory ( PackagesDirectory )
185183 . SetSymbolPackageFormat ( DotNetSymbolPackageFormat . snupkg )
186184 . EnableIncludeSymbols ( )
185+ . SetDeterministic ( IsContinuousIntegration )
186+ . SetContinuousIntegrationBuild ( IsContinuousIntegration )
187187 . SetVersion ( GitVersion . NuGetVersionV2 )
188188 . SetAssemblyVersion ( GitVersion . AssemblySemVer )
189189 . SetFileVersion ( GitVersion . AssemblySemFileVer )
190190 . SetInformationalVersion ( GitVersion . InformationalVersion )
191- . SetDeterministic ( IsDeterministic )
192- . SetContinuousIntegrationBuild ( IsContinuousIntegration )
193191 . SetProcessArgumentConfigurator ( a => a
194192 . Add ( "/p:CheckEolTargetFramework=false" ) )
195193 . CombineWith ( CSharpLibraries , ( s , p ) => s . SetProject ( p ) ) ) ;
@@ -199,11 +197,11 @@ partial class Build : NukeBuild
199197 . SetOutputDirectory ( PackagesDirectory )
200198 . SetSymbolPackageFormat ( DotNetSymbolPackageFormat . snupkg )
201199 . EnableIncludeSymbols ( )
200+ . SetContinuousIntegrationBuild ( IsContinuousIntegration )
202201 . SetVersion ( GitVersion . NuGetVersionV2 )
203202 . SetAssemblyVersion ( GitVersion . AssemblySemVer )
204203 . SetFileVersion ( GitVersion . AssemblySemFileVer )
205204 . SetInformationalVersion ( GitVersion . InformationalVersion )
206- . SetContinuousIntegrationBuild ( IsContinuousIntegration )
207205 . SetProcessArgumentConfigurator ( a => a
208206 . Add ( "/p:CheckEolTargetFramework=false" ) )
209207 . CombineWith ( FSharpLibraries , ( s , p ) => s . SetProject ( p ) ) ) ;
0 commit comments