In the above code, i have three tasks : task1, task2, task3. Task3 willl set the variable. And, task1 and task 2 will use this. Also, both these tasks are grouped. If i add te dependson to the taskgroup , it does not work. If i add task3 on task1 and task2, then it works.
The order in which task1 and task2 are executed is arbitrary in this code. If task1 must run before task2 you can either add “task2.dependsOn ‘task1’” or “task2.mustRunAfter ‘task1’”.
I suspect that it would help to read up on the DAG. Gradle task interactions are all about setting up dependencies and letting gradle set up the task graph accordingly.
Rereading this, it looks like it is in a plug-in. the code is basically the same, except you’ll use
project.task("task1") << this.&task1
Everything else is the same. I haven’t used the redirect to a method for awhile, so the syntax might not be right. But I’m pretty sure that the issue you’re having with with dependency ordering.
Also, the group concept is only for documentation. It doesn’t have any affect on task ordering.