cake-build / cake

:cake: Cake (C# Make) is a cross platform build automation system.
https://cakebuild.net
MIT License
3.87k stars 727 forks source link

GH2470: call multiple tasks from cli and pass them to run target #4054

Closed FrankRay78 closed 1 year ago

FrankRay78 commented 1 year ago

This PR fully implements #2470, 'Call multiple tasks from CLI and pass them to RunTarget'

Significant unit test coverage has been added for the changes, including minor refactoring and improvements to the existing codebase when encountered.

Significant effort was undertaken to ensure the changes introduced in this PR maintained backward compatibility.

Given the following cake build script,

var targets = Arguments<string>("target", "A");

Task("A");

Task("B");

Task("C");

RunTargets(targets);

This PR extends Cake to operate as follows:

image

image

image

devlead commented 1 year ago

@FrankRay78 your changes have been merged, thanks for your contribution 👍

juwens commented 1 year ago

@devlead and @FrankRay78 is this supposed to work with frosting?

when i do build.ps1 --target=A --target=B only B gets executed.

punker76 commented 11 months ago

@devlead and @FrankRay78 is this supposed to work with frosting?

when i do build.ps1 --target=A --target=B only B gets executed.

@juwens You must use RunTargets instead RunTarget in your cake script

RunTargets(Arguments<string>("target", new []{ "Default" }))

Then you can run multiple targets

dotnet-cake.exe build.cake --target=target1 --target=target2