Allow 'gradle eclipse' without 'cleanEclipse'

Allow eclipse projects to be regenerated without first requiring the
'gradle cleanEclipse' task to be executed.
This commit is contained in:
Phillip Webb 2013-01-14 10:25:33 -08:00
parent 8694a0aac0
commit f57c24cd8c
1 changed files with 7 additions and 0 deletions

View File

@ -28,6 +28,13 @@ eclipse.classpath.file.whenMerged { classpath ->
// Use separate main/test outputs (prevents WTP from packaging test classes)
eclipse.classpath.defaultOutputDir = file(project.name+"/eclipse/bin")
eclipse.classpath.file.beforeMerged { classpath ->
classpath.entries.findAll{ it instanceof SourceFolder }.each {
if(it.output.startsWith("build/eclipse")) {
it.output = null
}
}
}
eclipse.classpath.file.whenMerged { classpath ->
classpath.entries.findAll{ it instanceof SourceFolder }.each {
it.output = "build/eclipse/" + it.path.split("/")[1]