-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues when build has no default target defined
- Loading branch information
Showing
15 changed files
with
105 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
source/Nuke.Common/Execution/HandleHelpRequestAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2019 Maintainers of NUKE. | ||
// Distributed under the MIT License. | ||
// https://github.com/nuke-build/nuke/blob/master/LICENSE | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Nuke.Common.Execution | ||
{ | ||
[AttributeUsage(AttributeTargets.Class)] | ||
internal class HandleHelpRequestAttribute : Attribute, IPostLogoBuildExtension | ||
{ | ||
public void Execute( | ||
NukeBuild build, | ||
IReadOnlyCollection<ExecutableTarget> executableTargets, | ||
IReadOnlyCollection<ExecutableTarget> executionPlan) | ||
{ | ||
if (!NukeBuild.Help && executionPlan.Count > 0) | ||
return; | ||
|
||
Logger.Normal(HelpTextService.GetTargetsText(build.ExecutableTargets)); | ||
Logger.Normal(HelpTextService.GetParametersText(build)); | ||
|
||
Environment.Exit(exitCode: 0); | ||
} | ||
} | ||
} |
29 changes: 0 additions & 29 deletions
29
source/Nuke.Common/Execution/HandleHelpRequestsAttribute.cs
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
source/Nuke.Common/Execution/HandlePlanRequestAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2019 Maintainers of NUKE. | ||
// Distributed under the MIT License. | ||
// https://github.com/nuke-build/nuke/blob/master/LICENSE | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Nuke.Common.Execution | ||
{ | ||
[AttributeUsage(AttributeTargets.Class)] | ||
internal class HandlePlanRequestAttribute : Attribute, IPostLogoBuildExtension | ||
{ | ||
public void Execute( | ||
NukeBuild build, | ||
IReadOnlyCollection<ExecutableTarget> executableTargets, | ||
IReadOnlyCollection<ExecutableTarget> executionPlan) | ||
{ | ||
if (!NukeBuild.Plan) | ||
return; | ||
|
||
ExecutionPlanHtmlService.ShowPlan(build.ExecutableTargets); | ||
Environment.Exit(exitCode: 0); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters