Hi guys,
Just sharing the IDEA project generation section of my build.gradle
for others.  It builds on the documentation, adding settings that all
our developers use for a given project.

Specifically, this shows how to:
- specify the JDK (named "1.6" in this case)
- set the GRADLE_HOME variable for the project, as used by IDEA. This
is needed for the Gradle GUI plugin.
- exclude the build and .gradle directories in IDEA.

Improvement suggestions are welcome. e.g. the way I added the
GradleSettings node to the root seems clunky, but I didn't see an easy
way to make it more MarkupBuilder-ish.  HTH.


// IDEA project file generation configuration
buildscript {
    repositories {
        mavenRepo urls: 'http://gradle.artifactoryonline.com/gradle/plugins'
    }
    dependencies {
        classpath "org.gradle.plugins:gradle-idea-plugin:0.3.1"
    }
}

ideaProject {
    javaVersion = '1.6'
    withXml { root ->
        root.component.find { i...@name == 'VcsDirectoryMappings'
}.mappi...@vcs = 'hg4idea'
        def gradleSettings = new Node(root, 'component',
[name:'GradleSettings'])
        def gradleSettingsOption = new Node(gradleSettings, 'option',
[name:'SDK_HOME', value: System.getenv()['GRADLE_HOME']])
    }
}

ideaModule {
    excludeDirs = [file('./build'), file('./.gradle')]
}

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

    http://xircles.codehaus.org/manage_email


Reply via email to