cake-build / cake

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

Support for executing specific targets from the command line #618

Closed pauldotknopf closed 8 years ago

pauldotknopf commented 8 years ago

Most build environments allow you to do "build clean", or "build test" or "build compile".

This could probably be supported by passing in custom arguments, but those arguments would have to be manually interpreted and wired up.

For example, we should be able to do: build -targets Clean

pauldotknopf commented 8 years ago

Dooh! I spoke to soon!

var target = Argument("target", "Default");
...
RunTarget(target);

I think this should be called out in the documentation, even though it is implement in the .cake file, and not in the build system itself.

patriksvensson commented 8 years ago

@theonlylawislove

Not sure if I misunderstand your question, but the information you are looking for can be found in the documentation: http://cakebuild.net/docs/fundamentals/running-targets.

pauldotknopf commented 8 years ago

I didn't see how to provide the target argument from the command line. I found out how after checking the ps1 file.

./build.ps1 -Target Build