Hi,

With the build-announcements plugin, we have a plugin that:
* should only be applied once per build.
* needs to be usable from an init script
* needs to be usable early in the build, before we've loaded any projects.

Which suggests that it should be applied to the Gradle instance, rather than a 
particular project. That is, in an init script you'd do this:

apply plugin: 'build-annoucements'

And in a build script:

gradle.apply plugin: 'build-announcements'

or perhaps just:

apply plugin: 'build-announcements' 

knows that this plugin's target is a Gradle instance and applies it to the 
Gradle instance instead of the Project instance.

Not sure what to do about configuration for this kind of plugin. If we followed 
our current pattern, we'd use an extension on the 'gradle' object:

// init.gradle
apply plugin: 'build-announcements'

announcements {
    sendTo growl
    sendTo email { .... }
}

// build.gradle
gradle.apply plugin: 'build-announcements'

gradle.announcements {
    ....
}

It's a bit awkward having to use a different namespace in different scripts.

Thoughts/suggestions?


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com

Reply via email to