Can a custom plugin apply another plugin when applied to a project?

(Joshua Street) #1

My custom plugin, when applied, needs some properties that come from other plugins. For example, I would like to get access to the project’s jar properties from my custom plugin. My plugin is useless without the java plugin.

How can make sure that projects that use my plugin, also have the java plugin applied as well?

(Chris Doré) #2

In your plugin’s apply method, simply call project.apply(<other plugin>) just like you would in a build.gradle.

(Joshua Street) #3

I’m glad it was this easy. Thanks for the help.