On 10/10/11 12:16, Peter Niederwieser wrote:
Rob Kirkbride wrote:
Is it possible to do something like if gradle version is milestone 3 then
config looks like X
otherwise config looks like Y?

Try:

if (GradleVersion.current()<= GradleVersion.version("1.0-milestone-3")) {
... } else { ... }

This will work as long as you don't use any m5-only (or m3-only) class names
in your build script. If you need that (unlikely in the case of the Sonar
plugin), you should be able to factor out any version-specific configuration
into its own build script and apply it  with 'apply from:'.

That works a treat, thanks. The only remaining issue I've got now is that it's a multi project build and I get the following error :

Cause: There's an extension registered with name 'sonar'. You should not reassign it via a property setter.

Basically each build.gradle has a
apply plugin : 'sonar'
apply from :  'http://<ip-addr>/our_sonar_settings.gradle'

I guess it's objecting to the fact I'm setting the sonar settings again? If so, can it say only apply the settings if not already done?

Rob


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to