I’ve got a master build.gradle, which uses a custom plugin. The plugin does all sorts of things, but it also defines a couple of task classes. To amend the functionality of the plugin, I iterate over all tasks with the specific type:
I’ve now reached a point where I want to tidy this up a bit, and also re-use some of this logic in another project. It’s not quite ready to become a plugin on its own, so I just want to move this logic into a separate file and use
apply from:. However, in the separate file, I cannot access the plugin task definition without adding it as a dependency, including repositories, etc., which leads to more repetition than I save.
So I wonder, is there any non-verbose way to have root gradle dependencies/types exposed to imported scripts, or do I have to move this to buildSrc, or even a plugin?