Cake Frosting and Tasks #4159
-
Hi! I'm super new to Cake, just started my first project using Cake Frosting since I like the "full-blown type safety" of that approach. I've been setting up my fair share of XML-files with MSBuild so I get the idea of a Task that depends on another Task etc. However, in the context of a Frosting-project I'm kind of tempted not to use the Tasks and to just use method-calls to perform the steps in the build. I feel that it would be easier to understand and follow the flow. However, I also feel like I'm missing some point here... is there any drawback to the approach that I'm proposing? Why should I use Tasks over method calls and what would be any pros/cons? Cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Compared to plain methods, tasks can have dependencies, run only on specific criteria, support error handling. Additionally they have integrated support in the runner, by being able to run specific tasks, ignore dependencies of tasks or show a summary of task durations. But you don't need to decide between only tasks or only pure methods and can mix them based on your specific requirements. |
Beta Was this translation helpful? Give feedback.
-
Thank you @pascalberger! After playing around and reading the docs closer I realized, like you write, that the fact that one could execute a given task from the command line might be valuable in some scenarios. I also find it nice that the console output keeps track of each Task (time taken etc) and outputs this in a nice way. Also, as you say, there is nothing that prevents me from using pure methods if I wanted to, and also nice to get your confirmation. Once again, thanks for taking the time to answer! |
Beta Was this translation helpful? Give feedback.
Compared to plain methods, tasks can have dependencies, run only on specific criteria, support error handling. Additionally they have integrated support in the runner, by being able to run specific tasks, ignore dependencies of tasks or show a summary of task durations.
But you don't need to decide between only tasks or only pure methods and can mix them based on your specific requirements.