Ordering between @RuleSource/@Mutate calls

I’m developing a custom plugin that should be applied after having applied the ivy-publish plugin.

I’m adding custom logic on top of the Ivy Publish Plugin, and in particular, I’m adding tasks that sall be called before certain tasks from the Ivy publish plugin

But, to make things more complicated, I need to create my custom tasks in a project.afterEvaluate {} block because it relies on info given by the final user in his build script.

So, the build flow is
1°) apply Ivy-publish plugin
2°) apply my custom plugin
3)° project is evaluated
4°) - here I need to create my custom tasks
5°) - here I need to do : myCustomTask.finalizedBy(someTasksFromTheIvyPublishPlugin)

The problem is that the IvyPublish plugin creates its tasks thanks to the new @RuleSource/@Mutate annotations.
How can I ensure that the ivy publish plugin ‘createTasks’ method has been called, before doing my finalizedBy stuff ?

PS: This discussion was originally started on the old forum but I can’t find the old thread in the new forum

If you can infer the name of the task you need to depend on, you can just pass the task name as a String which doesn’t require the publishing task to exist at the time you are configuring your custom task.

OK, I went with your solution, thanks mark