forked from spockframework/spock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathide.gradle
35 lines (31 loc) · 974 Bytes
/
ide.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
allprojects {
apply plugin: "idea"
apply plugin: "eclipse"
idea {
module {
outputFile = file(outputFile.path.replace(".iml", "-${variant}.iml"))
}
}
}
def gitIgnore = file(".gitignore").readLines()
def gitIgnoreDirs = gitIgnore*.trim().findAll { !it.startsWith("#") && it.endsWith("/") }
def (topLevelDirs, allLevelDirs) = gitIgnoreDirs.split { it.startsWith("/") }
topLevelDirs = topLevelDirs.collect { it.substring(1) }
idea {
project {
languageLevel = "1.6"
vcs = "Git"
outputFile = file(outputFile.path.replace(".ipr", "-${variant}.ipr"))
configure(modules) { module ->
def prj = module.project
excludeDirs = prj.files(allLevelDirs) as Set
if (prj == prj.rootProject) {
excludeDirs += allLevelDirs.collect { prj.file("buildSrc/$it") }
excludeDirs += (prj.files(topLevelDirs) as Set)
}
}
}
}
ideaWorkspace {
outputFile = file(outputFile.path.replace(".iws", "-${variant}.iws"))
}