Prerequisites
Cake runner
Cake .NET Tool
Cake version
3.0.0
Operating system
Windows
Operating system architecture
64-Bit
CI Server
No response
What are you seeing?
When running multiple targets via the RunTargets method in dotnet cake v3.0.0, the SetupContext.TasksToExecute property passed to the script's Setup delegate only lists the tasks that will be run for the first target specified, rather than the tasks to run for all specified targets.
What is expected?
I would expect the SetupContext.TasksToExecute property to contain all tasks that will be run across all specified targets rather than just the first target.
Steps to Reproduce
Setup(context => {
Console.WriteLine($"Tasks to run: {string.Join(", ", context.TasksToExecute.Select(x => x.Name))}");
});
Task("A").Does(() => {
Console.WriteLine("Running A");
});
Task("B").Does(() => {
Console.WriteLine("Running B");
});
RunTargets(new [] { "A", "B" });
Resulting output when running dotnet cake is:
----------------------------------------
Setup
----------------------------------------
Tasks to run: A
========================================
A
========================================
Running A
========================================
B
========================================
Running B
Output log
No response
Prerequisites
Cake runner
Cake .NET Tool
Cake version
3.0.0
Operating system
Windows
Operating system architecture
64-Bit
CI Server
No response
What are you seeing?
When running multiple targets via the
RunTargetsmethod indotnet cakev3.0.0, theSetupContext.TasksToExecuteproperty passed to the script'sSetupdelegate only lists the tasks that will be run for the first target specified, rather than the tasks to run for all specified targets.What is expected?
I would expect the
SetupContext.TasksToExecuteproperty to contain all tasks that will be run across all specified targets rather than just the first target.Steps to Reproduce
Resulting output when running
dotnet cakeis:Output log
No response