Hi all,
first of all thanks to the gradle and STS team for providing a eclipse plugin!
we recently migrated all projects to gradle and feel very cozy with it.
One of the things we really appreciate while working with gradle is the ease to
configure a eclipse project.
Now we tried to make use of the STS plugin, at first with a mid-size
single-project java application.
What we use is the hook in the eclipse plugin - this gave us the possibility to
sort all dependencies and source folders.
eclipseClasspath{
whenConfigured { classpath ->
// find all sources
def allSources = classpath.entries.findAll{ it?.kind == "src"
}.sort{ it.path }
// change output of test sources
def testSources = allSources.findAll{ it?.path ==~ /.*test.*/
}.each{ it.output = "bin-test"}
// find "code" sources e.g. sym, core, etc
def sources = allSources - testSources;
// find libs and sort
def remainingClasspath = (classpath.entries - allSources).sort{
it.path.tokenize('/').last().toLowerCase() }
// add both
classpath.entries = sources + testSources + remainingClasspath
//
println " > sorted classpath entries"
}
}
Maybe the sorting of dependencies could be an improvement for the STS gradle
plugin,
as currently the gradle managed dependencies are not sorted, and hard to
overlook.
regards,
Elmar