@@ -29,28 +29,19 @@ Setup(context =>
2929
3030 // Executed BEFORE the first task.
3131 Information ( "Xer.DomainDriven" ) ;
32- Information ( "Parameters" ) ;
33- Information ( "///////////////////////////////////////////////////////////////////////////////" ) ;
34- Information ( "Branch: {0}" , buildParameters . BranchName ) ;
35- Information ( "Version semver: {0}" , buildParameters . GitVersion . LegacySemVerPadded ) ;
36- Information ( "Version assembly: {0}" , buildParameters . GitVersion . AssemblySemVer ) ;
37- Information ( "Version informational: {0}" , buildParameters . GitVersion . InformationalVersion ) ;
38- Information ( "Master branch: {0}" , buildParameters . IsMasterBranch ) ;
39- Information ( "Release branch: {0}" , buildParameters . IsReleaseBranch ) ;
40- Information ( "Dev branch: {0}" , buildParameters . IsDevBranch ) ;
41- Information ( "Hotfix branch: {0}" , buildParameters . IsHotFixBranch ) ;
42- Information ( "Pull request: {0}" , buildParameters . IsPullRequest ) ;
43- Information ( "Publish to myget: {0}" , buildParameters . ShouldPublishMyGet ) ;
44- Information ( "Publish to nuget: {0}" , buildParameters . ShouldPublishNuGet ) ;
45- Information ( "Execute git tag: {0}" , buildParameters . ShouldExecuteGitTag ) ;
46- Information ( "///////////////////////////////////////////////////////////////////////////////" ) ;
47-
32+ Information ( "===========================================================================================" ) ;
33+ Information ( "Git Version" ) ;
34+ Information ( "Semver: {0}" , buildParameters . GitVersion . LegacySemVerPadded ) ;
35+ Information ( "Major minor patch: {0}" , buildParameters . GitVersion . MajorMinorPatch ) ;
36+ Information ( "Assembly: {0}" , buildParameters . GitVersion . AssemblySemVer ) ;
37+ Information ( "Informational: {0}" , buildParameters . GitVersion . InformationalVersion ) ;
4838 if ( DirectoryExists ( buildParameters . BuildArtifactsDirectory ) )
4939 {
5040 // Cleanup build artifacts.
5141 Information ( $ "Cleaning up { buildParameters . BuildArtifactsDirectory } directory.") ;
5242 DeleteDirectory ( buildParameters . BuildArtifactsDirectory , new DeleteDirectorySettings { Recursive = true } ) ;
5343 }
44+ Information ( "===========================================================================================" ) ;
5445} ) ;
5546
5647Teardown ( context =>
@@ -158,6 +149,7 @@ Task("Test")
158149} ) ;
159150
160151Task ( "Pack" )
152+ . Description ( "Create NuGet packages." )
161153 . IsDependentOn ( "Test" )
162154 . Does ( ( ) =>
163155{
@@ -183,74 +175,12 @@ Task("Pack")
183175 }
184176} ) ;
185177
186- Task ( "PublishMyGet" )
187- . WithCriteria ( ( ) => buildParameters . ShouldPublishMyGet )
188- . IsDependentOn ( "Pack" )
189- . Does ( ( ) =>
190- {
191- // Nupkgs in BuildArtifacts folder.
192- var nupkgs = GetFiles ( buildParameters . BuildArtifactsDirectory + "/*.nupkg" ) ;
193-
194- if ( nupkgs . Count ( ) == 0 )
195- {
196- Information ( "No nupkgs found." ) ;
197- return ;
198- }
199-
200- foreach ( var nupkgFile in nupkgs )
201- {
202- Information ( "Pulishing to myget {0}" , nupkgFile ) ;
203- NuGetPush ( nupkgFile , new NuGetPushSettings
204- {
205- Source = buildParameters . MyGetFeed ,
206- ApiKey = buildParameters . MyGetApiKey
207- } ) ;
208- }
209- } ) ;
210-
211- Task ( "PublishNuGet" )
212- . WithCriteria ( ( ) => buildParameters . ShouldPublishNuGet && ! string . IsNullOrWhiteSpace ( "APPVEYOR_REPO_TAG_NAME" ) )
213- . IsDependentOn ( "Pack" )
214- . Does ( ( ) =>
215- {
216- // Nupkgs in BuildArtifacts folder.
217- var nupkgs = GetFiles ( buildParameters . BuildArtifactsDirectory + "/*.nupkg" ) ;
218-
219- if ( nupkgs . Count ( ) == 0 )
220- {
221- Information ( "No nupkgs found." ) ;
222- return ;
223- }
224-
225- foreach ( var nupkgFile in nupkgs )
226- {
227- Information ( "Pulishing to nuget {0}" , nupkgFile ) ;
228- NuGetPush ( nupkgFile , new NuGetPushSettings
229- {
230- Source = buildParameters . NuGetFeed ,
231- ApiKey = buildParameters . NuGetApiKey
232- } ) ;
233- }
234- } ) ;
235-
236- Task ( "GitTag" )
237- . WithCriteria ( ( ) => buildParameters . ShouldExecuteGitTag )
238- . IsDependentOn ( "PublishNuGet" )
239- . Does ( ( ) =>
240- {
241- Information ( $ "Creating git tag: { buildParameters . GitTagName } ") ;
242- GitTag ( "./" , buildParameters . GitTagName ) ;
243- } ) ;
244-
245178///////////////////////////////////////////////////////////////////////////////
246179// TARGETS
247180///////////////////////////////////////////////////////////////////////////////
248181
249182Task ( "Default" )
250183 . Description ( "This is the default task which will be ran if no specific target is passed in." )
251- . IsDependentOn ( "GitTag" )
252- . IsDependentOn ( "PublishNuGet" )
253- . IsDependentOn ( "PublishMyGet" )
254184 . IsDependentOn ( "Pack" )
255185 . IsDependentOn ( "Test" )
256186 . IsDependentOn ( "Build" )
@@ -276,53 +206,6 @@ public class BuildParameters
276206
277207 public GitVersion GitVersion => _gitVersion ;
278208
279- public bool IsAppVeyorBuild => _context . BuildSystem ( ) . AppVeyor . IsRunningOnAppVeyor ;
280-
281- public bool IsLocalBuild => _context . BuildSystem ( ) . IsLocalBuild ;
282-
283- public bool IsPullRequest => _context . BuildSystem ( ) . AppVeyor . Environment . PullRequest . IsPullRequest ;
284-
285- public string BranchName
286- {
287- get
288- {
289- return IsLocalBuild
290- ? _context . GitBranchCurrent ( "." ) . FriendlyName
291- : _context . BuildSystem ( ) . AppVeyor . Environment . Repository . Branch ;
292- }
293- }
294-
295- public string GitHubUsername => _context . EnvironmentVariable ( "GITHUB_USERNAME" ) ;
296-
297- public string GitHubPassword => _context . EnvironmentVariable ( "GITHUB_PASSWORD" ) ;
298-
299- public string MyGetFeed => _context . EnvironmentVariable ( "MYGET_SOURCE" ) ;
300-
301- public string MyGetApiKey => _context . EnvironmentVariable ( "MYGET_API_KEY" ) ;
302-
303- public string NuGetFeed => _context . EnvironmentVariable ( "NUGET_SOURCE" ) ;
304-
305- public string NuGetApiKey => _context . EnvironmentVariable ( "NUGET_API_KEY" ) ;
306-
307- public bool IsMasterBranch => StringComparer . OrdinalIgnoreCase . Equals ( "master" , BranchName ) ;
308-
309- public bool IsDevBranch => StringComparer . OrdinalIgnoreCase . Equals ( "dev" , BranchName ) ;
310-
311- public bool IsReleaseBranch => BranchName . StartsWith ( "release" , StringComparison . OrdinalIgnoreCase ) ;
312-
313- public bool IsHotFixBranch => BranchName . StartsWith ( "hotfix" , StringComparison . OrdinalIgnoreCase ) ;
314-
315- public bool ShouldPublishMyGet => ! string . IsNullOrWhiteSpace ( MyGetApiKey ) && ! string . IsNullOrWhiteSpace ( MyGetFeed ) ;
316-
317- public bool ShouldPublishNuGet => ! string . IsNullOrWhiteSpace ( NuGetApiKey )
318- && ! string . IsNullOrWhiteSpace ( NuGetFeed )
319- && ( IsMasterBranch || IsHotFixBranch || IsReleaseBranch )
320- && ! IsPullRequest ;
321-
322- public bool ShouldExecuteGitTag => ShouldPublishNuGet ;
323-
324- public string GitTagName => $ "v{ GitVersion . SemVer } ";
325-
326209 public string BuildArtifactsDirectory => "./BuildArtifacts" ;
327210
328211 public ProcessArgumentBuilder AppendVersionArguments ( ProcessArgumentBuilder args ) => args
0 commit comments