Bundle dependencies with plugin


(Ralph van Etten) #1

I have a custom plugin which depends on some other plugins. Is it possible to bundle my custom plugin together with the plugins it depends on so that I only have to include my own plugin in my projects?

Currently I have the plugins my plugin depends on as compile dependencies. This works ok but requires me to set buildScript { repositories { ... } } on every project which uses my plugin because not all plugins I’m using are available from the standard location.

One option would be to setup my own local repository and copy all the plugins I use into that repository but I rather create some sort of bundle of all the plugins I need and just include that bundle without any external dependencies.

Is that possible?


(Schalk Cronjé) #2

I can see three options:

[1] Create a gradle script which lists all of the plugins to be applied. The apply the script via apply from.

[2] Create a meta-plugin to do this. The build for this plugins just lists all of the others as dependencies. The plugin class then applies all of the plugins.

[3] Build a custom Gradle distro, which bundles all of teh plugins and applies them via an init script.