Yes you can accomplish that. Default configs can be added when the master plugin is installed. Manually you can do as a post initialization configuration in
doWithApplicationContext
. But there is a convenientplugin-config plugin
which can do that for you. Add this plugin to master plugin and set up default values for the widget plugin. The doc for plugin is self-explanatory. If not, I can add an example.Any config provided by the plugin can be overridden in application's
Config.groovy
. Application's config is initialized in the end (after all plugins are initialized). So you can definitely override the default config which you would have setup from step 1 above.You can
exclude
widget plugin from the master plugin when required, in application'sBuildConfig
.
Example:
//BuildConfig in application
plugins {
compile(':master:0.1') {
//exclusion based on some logic at build/compile time
if(some logic satisfied) {
excludes 'widget'
}
}
}