Skip to content

Commit

Permalink
Add NoLogo parameter and change actual logo
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Mar 24, 2019
1 parent e735514 commit 56128d3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
1 change: 1 addition & 0 deletions shell-completion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Host:
- TeamCity
- TeamServices
- Travis
NoLogo:
Plan:
Root:
Skip:
Expand Down
24 changes: 18 additions & 6 deletions source/Nuke.Common/Execution/BuildManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,20 @@ public static int Execute<T>(Expression<Func<T, Target>> defaultTargetExpression
Logger.LogLevel = NukeBuild.LogLevel;
ToolPathResolver.NuGetPackagesConfigFile = build.NuGetPackagesConfigFile;

Logger.Normal($"NUKE Execution Engine {typeof(BuildManager).Assembly.GetInformationalText()}");
Logger.Normal(FigletTransform.GetText("NUKE"));
if (!NukeBuild.NoLogo)
{
Logger.Normal();
Logger.Normal("███╗ ██╗██╗ ██╗██╗ ██╗███████╗");
Logger.Normal("████╗ ██║██║ ██║██║ ██╔╝██╔════╝");
Logger.Normal("██╔██╗ ██║██║ ██║█████╔╝ █████╗ ");
Logger.Normal("██║╚██╗██║██║ ██║██╔═██╗ ██╔══╝ ");
Logger.Normal("██║ ╚████║╚██████╔╝██║ ██╗███████╗");
Logger.Normal("╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝");
Logger.Normal();
}

Logger.Info($"NUKE Execution Engine {typeof(BuildManager).Assembly.GetInformationalText()}");
Logger.Normal();

build.ExecuteExtensions<IPostLogoBuildExtension>();
build.ExecutionPlan = ExecutionPlanner.GetExecutionPlan(
Expand Down Expand Up @@ -127,9 +139,9 @@ string CreateLine(string target, string executionStatus, string duration, string
string ToMinutesAndSeconds(TimeSpan duration)
=> $"{(int) duration.TotalMinutes}:{duration:ss}";

Logger.Normal(new string(c: '=', count: allColumns));
Logger.Normal(new string(c: '', count: allColumns));
Logger.Info(CreateLine("Target", "Status", "Duration"));
Logger.Normal(new string(c: '-', count: allColumns));
Logger.Normal(new string(c: '', count: allColumns));
foreach (var target in build.ExecutionPlan)
{
var line = CreateLine(target.Name, target.Status.ToString(), ToMinutesAndSeconds(target.Duration), target.SkipReason);
Expand All @@ -149,9 +161,9 @@ string ToMinutesAndSeconds(TimeSpan duration)
}
}

Logger.Normal(new string(c: '-', count: allColumns));
Logger.Normal(new string(c: '', count: allColumns));
Logger.Info(CreateLine("Total", "", ToMinutesAndSeconds(totalDuration)));
Logger.Normal(new string(c: '=', count: allColumns));
Logger.Normal(new string(c: '', count: allColumns));
Logger.Normal();

var buildSucceeded = IsSuccessful(build);
Expand Down
9 changes: 8 additions & 1 deletion source/Nuke.Common/NukeBuild.Statics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ static NukeBuild()
Continue = ParameterService.Instance.GetParameter(() => Continue);
Plan = ParameterService.Instance.GetParameter(() => Plan);
Help = ParameterService.Instance.GetParameter(() => Help);
NoLogo = ParameterService.Instance.GetParameter(() => NoLogo);
}

/// <summary>
Expand All @@ -51,7 +52,7 @@ static NukeBuild()
public static PathConstruction.AbsolutePath BuildAssemblyDirectory { get; }

/// <summary>
/// Gets the full path to the build project directory, or <c>null</c>
/// Gets the full path to the build project directory, or <c>null</c>
/// </summary>
[CanBeNull]
public static PathConstruction.AbsolutePath BuildProjectDirectory { get; }
Expand Down Expand Up @@ -80,6 +81,12 @@ static NukeBuild()
[Parameter("Shows the help text for this build assembly.")]
public static bool Help { get; }

/// <summary>
/// Gets a value whether to display the NUKE logo.
/// </summary>
[Parameter("Disables displaying the NUKE logo.")]
public static bool NoLogo { get; }

public static bool IsLocalBuild => Host == HostType.Console;
public static bool IsServerBuild => Host != HostType.Console;

Expand Down

0 comments on commit 56128d3

Please sign in to comment.