Permalink
Browse files

Add a first cut at Eclipse and IntelliJ IDEA project generation from …

…Gradle.
  • Loading branch information...
1 parent 5981009 commit 55a42ab5bc47fd05714b0c8bdd68956b6c368845 @russel russel committed Jan 14, 2013
Showing with 38 additions and 1 deletion.
  1. +7 −1 .gitignore
  2. +31 −0 build.gradle
View
@@ -2,7 +2,6 @@
/artwork/*.png
/bin/
/out/
-Gant.iws
.gradle
/build/
/gant/
@@ -11,3 +10,10 @@ Gant.iws
texput.log
nbbuild.xml
/nbproject/
+Gant.iws
+Gant.iml
+Gant.ipr
+/.idea/
+.classpath
+.project
+/.settings/
View
@@ -16,6 +16,9 @@
//
// Author: Russel Winder <russel@winder.org.uk>
+apply plugin: 'eclipse'
+apply plugin: 'idea'
+
import org.apache.tools.ant.filters.ReplaceTokens
ext.artifact = 'gant'
@@ -673,3 +676,31 @@ task clobber(description: 'Do a really detailed clean.') << {
forEachProject{item -> delete item}
delete buildDir, 'texput.log'
}
+
+
+idea {
+ module {
+ excludeDirs += file('gradle/') // Gradle directory including the wrapper subdirectory.
+ excludeDirs += file('.gradle/') // Gradle directory
+ excludeDirs += file('.settings/') // Eclipse settings directory.
+ excludeDirs += file('bin') // Eclipse compilation directory.
+ excludeDirs += file('out') // IDEA compilation directory.
+ excludeDirs += file('build') // Gradle compilation directory.
+ }
+ project {
+ ext.javaVersion = '1.6'
+ ipr {
+ withXml { provider ->
+ def node = provider.asNode()
+ def vcsConfig = node.component.find { it.'@name' == 'VcsDirectoryMappings' }
+ vcsConfig.mapping[0].'@vcs' = 'Git'
+ def gradleSettings = node.appendNode('component', [name: 'GradleSettings'])
+ gradleSettings.appendNode('option', [name: 'SDK_HOME', value: gradle.gradleHomeDir.absolutePath])
+ }
+ whenMerged { project ->
+ project.jdk.languageLevel = 'JDK_1_6'
+ }
+ }
+ }
+}
+

0 comments on commit 55a42ab

Please sign in to comment.