Task chains #4368
ruslanmogilevskiy
started this conversation in
Ideas
Task chains
#4368
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I was trialing the Cake for a week to port my quite complex build to it and at first glance is looks smooth and cool. Thanks to the contributors for such a thing!
I'm using Cake Frosting to implement my build and after implementing dozen of build tasks I started to struggle with changing the build task chain (what task starts when) and moreover understanding the build chain later on. Say you need to add/remove the tasks in the future when you forgot what the heck is going on in your build. You will need a lot of time for this.
Yes, Cake has IsDependentOn/IsDependeeOf attributes and Cake.Graph plugin but IMO they aren't fixing the root cause of the problem - there is no clear and quick way to manage the tasks chain.
Unfortunately, Cake Frosting is quite closed in terms of extensibility (most of the classes are sealed. Why?) so my fix was an introduction of the task chain paradigm inside the Frosting project with keeping it as abstract as possible with abbility to extend it on the client side.
The sources are available here and the example project is here.
The task chain is enabled with a single line of confuguration code:
where you'll specify a task chain provider that's implemented in your build project and returns the tasks that will be executed and it looks like this:
With the task chain defined in your project, you can quickly manage your tasks (add, remove, comment (disable) specific tasks) and visualize what your build actually does even after some time. The task can be referenced by its type or name.
Also, you can group the tasks (.Group(...)) to visually aggregate them so the tasks after it are executed after all tasks in the group. The sub-groups are supported as well.
You can mix the chain approach with your existing code (with IsDependendOn) so the dependecies from the chain just will be added to your existing dependecies.
The build is executed from the top to bottom sequentially and the Default task will be dependent on the final task or group in your chain.
I'm still testing this approach with my build (25 tasks and growing) but it already saves huge amount of time for me.
I've created a draft PR to quickly identify the changes and gather feedback from the Community and @devlead .
Beta Was this translation helpful? Give feedback.
All reactions