Hi,
We are currently making the step to set some company-wide conventions/standards.
We would like to use them to simplify configuring our Gradle-based projects, by introducing a plug-in (written in Java), that contains these conventions and applies them to the project based on a minimal set of configuration parameters.
I’ve already managed to add one of the plugins we would like to depend on, by using:
public class MyPlugin implements Plugin<Project> {
public void apply(Project project)
{
project.getPlugins().apply(ExternalPlugin.class);
}
}
This works. I can see the tasks added by ExternalPlugin.
However, how can I configure this plugin?
For now I’m using settings.gradle
to provide the input for the configuration, as I can read this while I’m in the apply()
method (and the configuration I can define in build.gradle
for the plug-in using Extensions, is not).
Is there a way to add and configure other plug-ins after reading the configuration based on my plugins extension?
In short: How can I configure another plug-in using an instance of Project
in Java?
(How) can I do this after the configuration in build.gradle
is loaded?
Hopefully someone can help me.
Thanks,
Arno