On 11/04/2011, at 6:06 AM, Rene Groeschke wrote:
> Hi Joern,
> you may use init scripts for that. in your init script you could have
> something like this:
>
> ---------------------
> addListener(new ApplyPluginListener())
>
> class ApplyPluginListener extends BuildAdapter {
> public void projectsEvaluated(Gradle gradle) {
> gradle.rootProject.allprojects { apply plugin: 'announce }
> }
> }
You can simplify this a bit:
projectsEvaluated {
rootProject.allprojects { apply plugin: 'announce' }
}
At some point, maybe when we clean up how settings.gradle works, you should be
able to do:
allprojects {
apply plugin: 'announce'
}
> ---------------------
>
> regards,
> René
>
>
> Am 10.04.11 21:57, schrieb Joern Huxhorn:
>> Hi everyone,
>>
>> is it possible to "inject" a plugin (as well as its configuration) into a
>> build without really adding it to the build file?
>>
>> It would be quite nice to have this ability.
>>
>> For example, the Announce plugin is very user/system-specific.
>> Ubuntu Notify, Snarl& Growl are providing the same functionality, just for
>> different operating systems. Some would like announcements while some
>> probably don't. This is a question of personal taste and not of the build
>> process, in my opinion.
>>
>> The fresh Sonar plugin is another example.
>> I'd like to be able to just apply the Sonar plugin to any Gradle build
>> without adding an 'apply plugin: "sonar"' to the build file, configuring it
>> somewhere (most likely using system properties) as needed.
>> The rationale for this is that I use Sonar on projects that I don't own. I
>> can do just that using the Maven Sonar plugin but I'm not aware how to do
>> this in Gradle.
>>
>> Chances are that I just don't know yet *how* to do it properly.
>>
>> Lastly, thanks a lot for implementing the Sonar plugin! I was really looking
>> forward to this feature.
>>
>> Cheers,
>> Joern.
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
>
>
> --
> -----------------------
> regards René
>
> rene groeschke
> http://www.breskeby.com
> @breskeby
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com