@@ -94,6 +94,14 @@ void VerifyHeaders(bool Replace)
9494 }
9595}
9696
97+ void RetrieveVersion ( )
98+ {
99+ Information ( "\n Retrieving version..." ) ;
100+ var results = StartPowershellFile ( versionClient ) ;
101+ Version = results [ 1 ] . Properties [ "NuGetPackageVersion" ] . Value . ToString ( ) ;
102+ Information ( "\n Build Version: " + Version ) ;
103+ }
104+
97105//////////////////////////////////////////////////////////////////////
98106// DEFAULT TASK
99107//////////////////////////////////////////////////////////////////////
@@ -137,14 +145,11 @@ Task("Version")
137145
138146 NuGetInstall ( new [ ] { "nerdbank.gitversioning" } , installSettings ) ;
139147
140- Information ( "\n Retrieving version..." ) ;
141- var results = StartPowershellFile ( versionClient ) ;
142- Version = results [ 1 ] . Properties [ "NuGetPackageVersion" ] . Value . ToString ( ) ;
143- Information ( "\n Build Version: " + Version ) ;
148+ RetrieveVersion ( ) ;
144149} ) ;
145150
146- Task( "Build " )
147- . Description ( "Build all projects and get the assemblies " )
151+ Task ( "BuildProjects " )
152+ . Description ( "Build all projects" )
148153 . IsDependentOn ( "Version" )
149154 . Does ( ( ) =>
150155{
@@ -173,9 +178,9 @@ Task("Build")
173178} ) ;
174179
175180Task ( "InheritDoc" )
176- . Description ( "Updates <inheritdoc /> tags from base classes, interfaces, and similar methods" )
177- . IsDependentOn ( "Build " )
178- . Does ( ( ) =>
181+ . Description ( "Updates <inheritdoc /> tags from base classes, interfaces, and similar methods" )
182+ . IsDependentOn ( "BuildProjects " )
183+ . Does ( ( ) =>
179184{
180185 Information ( "\n Downloading InheritDoc..." ) ;
181186 var installSettings = new NuGetInstallSettings {
@@ -201,9 +206,13 @@ Task("InheritDoc")
201206 Information ( "\n Finished generating documentation with InheritDoc" ) ;
202207} ) ;
203208
209+ Task ( "Build" )
210+ . Description ( "Build all projects runs InheritDoc" )
211+ . IsDependentOn ( "BuildProjects" )
212+ . IsDependentOn ( "InheritDoc" ) ;
213+
204214Task ( "Package" )
205215 . Description ( "Pack the NuPkg" )
206- . IsDependentOn ( "InheritDoc" )
207216 . Does ( ( ) =>
208217{
209218 // Invoke the pack target in the end
@@ -236,12 +245,14 @@ Task("Package")
236245 buildSettings . SetPlatformTarget ( PlatformTarget . x86 ) ;
237246 MSBuild ( Solution , buildSettings ) ;
238247
248+ RetrieveVersion ( ) ;
249+
239250 var nuGetPackSettings = new NuGetPackSettings
240251 {
241252 OutputDirectory = nupkgDir ,
242253 Version = Version
243254 } ;
244-
255+
245256 var nuspecs = GetFiles ( "./*.nuspec" ) ;
246257 foreach ( var nuspec in nuspecs )
247258 {
@@ -264,7 +275,6 @@ public string getMSTestAdapterPath(){
264275
265276Task ( "Test" )
266277 . Description ( "Runs all Tests" )
267- . IsDependentOn ( "Build" )
268278 . Does ( ( ) =>
269279{
270280 var vswhere = VSWhereLatest ( new VSWhereLatestSettings
@@ -300,7 +310,8 @@ Task("Test")
300310//////////////////////////////////////////////////////////////////////
301311
302312Task ( "Default" )
303- . IsDependentOn ( "Test" )
313+ . IsDependentOn ( "Build" )
314+ . IsDependentOn ( "Test" )
304315 . IsDependentOn ( "Package" ) ;
305316
306317Task ( "UpdateHeaders" )
0 commit comments