Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
env:
PUSH_SOURCE: https://api.nuget.org/v3/index.json
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
VersionPrefix: 5.0.0
VersionPrefix: 6.0.0-pre1
- uses: actions/upload-artifact@v4
with:
name: snaps
Expand Down
2 changes: 1 addition & 1 deletion build/build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

<ItemGroup>
<PackageReference Include="Cake.Console" Version="5.0.0-pre" />
<PackageReference Include="verify" Version="30.1.0" />
<PackageReference Include="verify" Version="31.20.0" />
</ItemGroup>
</Project>
29 changes: 16 additions & 13 deletions build/program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
{
Configuration = config,
NoLogo = true,
ArgumentCustomization = builder =>
builder.Append($"/p:VersionPrefix={version}"),
ArgumentCustomization = builder => builder.Append($"/p:VersionPrefix={version}"),
};
c.DotNetBuild(testProj, sett);
});
Expand Down Expand Up @@ -62,9 +61,9 @@
"cli --tree",
"cli --help",
"cli -h",
"cli --target=printargs --arg1=1 --arg2=x --super-long-arg=super-long-value,hello"
"cli --target=printargs --arg1=1 --arg2=x --super-long-arg=super-long-value,hello",
];

List<Exception> aggException = [];
foreach (var t in tests)
{
Expand All @@ -77,12 +76,16 @@
}
s.ScrubLinesContaining(StringComparison.OrdinalIgnoreCase, "00:00:0");
s.ScrubLinesWithReplace(l => l.Replace(pwd, "{CurrentDirectory}"));
s.ScrubLinesWithReplace(l => l.Replace("\u001b[1m","").Replace("\u001b[0m", ""));
s.ScrubLinesWithReplace(l => l.Replace("\u001b[1m", "").Replace("\u001b[0m", ""));
s.ScrubLinesWithReplace(l =>
new Regex(@"Details: 1\.2\.3\+.*").Replace(l, "Details: 1.2.3+{Hash}")
);
var result = Run(t);
await new InnerVerifier("build\\snapshots", $"Test_{t.Replace(" ", "_")}", s).Verify(result);
await new InnerVerifier(
"build\\snapshots",
$"Test_{t.Replace(" ", "_")}",
s
).Verify(result);
}
catch (Exception e)
{
Expand Down Expand Up @@ -115,9 +118,9 @@

host.Task("Push")
.WithCriteria(c =>
c.GitHubActions().IsRunningOnGitHubActions &&
!c.GitHubActions().Environment.PullRequest.IsPullRequest &&
c.HasEnvironmentVariable("NUGET_API_KEY")
c.GitHubActions().IsRunningOnGitHubActions
&& !c.GitHubActions().Environment.PullRequest.IsPullRequest
&& c.HasEnvironmentVariable("NUGET_API_KEY")
)
.IsDependentOn("Pack")
.Does(c =>
Expand All @@ -144,21 +147,21 @@ string Run(string cmd)
.Context.GetFiles("src/Cake.Console.Tests/bin/Release/*/Cake.Console.Tests.dll")
.First();
host.Context.Information($"Running: dotnet {dll} {cmd}");

// run cmd and get stdout/stderr
using Process process = new();
process.StartInfo = new ("dotnet", $"{dll} {cmd}")
process.StartInfo = new("dotnet", $"{dll} {cmd}")
{
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
CreateNoWindow = true,
WorkingDirectory = Environment.CurrentDirectory,
Environment = { {"NO_COLOR", "true"} }
Environment = { { "NO_COLOR", "true" } },
};

process.Start();

var output = process.StandardOutput.ReadToEnd().Trim();
output += process.StandardError.ReadToEnd();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PrintArgs
verbosity=Normal
--SomeVeryImportantData=Cake is awesome!

Task Duration
--------------------------------------------------
--------------------------------------------------
Task Duration Status
----------------------------------------------------------------------
----------------------------------------------------------------------
OK
6 changes: 3 additions & 3 deletions build/snapshots/Test_cli_--target=task1.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Task1
========================================
Task1 executed

Task Duration
--------------------------------------------------
--------------------------------------------------
Task Duration Status
----------------------------------------------------------------------
----------------------------------------------------------------------
OK
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Executing task: Task1
Task1 executed
Finished executing task: Task1

Task Duration
--------------------------------------------------
--------------------------------------------------
Task Duration Status
----------------------------------------------------------------------
----------------------------------------------------------------------
OK
6 changes: 3 additions & 3 deletions build/snapshots/Test_cli_--target=task2.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Task2
========================================
Task2 executed

Task Duration
--------------------------------------------------
--------------------------------------------------
Task Duration Status
----------------------------------------------------------------------
----------------------------------------------------------------------
OK
6 changes: 3 additions & 3 deletions build/snapshots/Test_cli_--target=taskB.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TaskB
========================================
TaskB executed

Task Duration
--------------------------------------------------
--------------------------------------------------
Task Duration Status
----------------------------------------------------------------------
----------------------------------------------------------------------
OK
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TaskB
========================================
TaskB executed

Task Duration
--------------------------------------------------
--------------------------------------------------
Task Duration Status
----------------------------------------------------------------------
----------------------------------------------------------------------
OK
6 changes: 3 additions & 3 deletions build/snapshots/Test_host.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Task1
========================================
Task1 executed

Task Duration
--------------------------------------------------
--------------------------------------------------
Task Duration Status
----------------------------------------------------------------------
----------------------------------------------------------------------
OK
2 changes: 1 addition & 1 deletion src/Cake.Console/Cake.Console.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<CakeVersion>5.0.0</CakeVersion>
<CakeVersion>6.2.0</CakeVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/Cake.Console/CommandApp/CakeCliCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ public sealed class Settings : CommandSettings
[Description("Displays additional information about Cake.")]
public bool Info { get; set; }
}

public override int Execute([NotNull] CommandContext context, [NotNull] Settings settings)
protected override int Execute(CommandContext context, Settings settings, CancellationToken cancellation)
{
if (settings.Info)
{
Expand Down
Loading