As can be seen in the documentation
<http://gradle.org/idea_plugin.html>(table 51), javaVersion is a
property of the ideaProject task.  So, to set
it use:

ideaProject {
   javaVersion = '1.6'
}

Also note that the property is a String so I quoted the 1.6.  Groovy may
autoconvert the type for you, but I like to be explicit (especially with
doubles, which are not a precise data type).


On Mon, Jun 7, 2010 at 6:00 PM, Dan Tanner <[email protected]> wrote:

> Hi guys,
>
> I'm a gradle newbie trying out the idea plugin, and having trouble
> configuring the generated project SDK.
>
> What I want is to set it to 1.6.  What's happening is that it's being
> set to 1.5.
>
> According to the docs in the IdeaProject task, setting the javaVersion
> parameter should affect the generated project SDK value.  One question
> is, where should that parameter go?  Can I set that as a top-level
> property in the build.gradle?  That's what I tried, but that's either
> the wrong place, or else it's not taking effect.  Bug or operator
> error?
>
> Here's my build.gradle:
> ----
> buildscript {
>   repositories {
>       mavenRepo urls: 'http://gradle.artifactoryonline.com/gradle/plugins'
>   }
>   dependencies {
>       classpath "org.gradle.plugins:gradle-idea-plugin:0.2"
>   }
> }
>
> apply plugin: 'org.gradle.idea'
> apply plugin: 'war'
>
> repositories {
>    mavenCentral()
> }
>
> dependencies {
>    compile group: 'commons-io', name: 'commons-io', version: '1.4'
>    compile group: 'log4j', name: 'log4j', version: '1.2.15', ext: 'jar'
>    testCompile group: 'junit', name: 'junit', version: '4.+'
> }
>
> // idea plugin parameters
> javaVersion = 1.6
> ----
>
> Thanks,
> Dan
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>


-- 
John Murph
Automated Logic Research Team

Reply via email to