Sam Brannen opened SPR-17004 and commented
Overview
Since Eclipse Photon supports separation of test source sets in the classpath, we should configure that within the Gradle build.
Workaround
The following workaround has been proposed by howlger until Gradle and Buildship properly support the new feature in Eclipse.
apply plugin: 'eclipse'
eclipse.classpath.file.whenMerged {
// separate output folders required to set the 'test' attribute
entries.find { it.path == 'src/main/java' }.output = 'bin/main'
def testSrc = entries.find { it.path == 'src/test/java' }
testSrc.output = 'bin/test'
testSrc.entryAttributes['test'] = 'true'
// libraries visible for test sources only?
entries.forEach { entry ->
def entryIn = { it.find { file(entry.path).equals(it) } }
if (entry.kind == 'lib') {
entry.entryAttributes['test'] =
entryIn(configurations.testRuntimeClasspath) &&
!entryIn(configurations.runtimeClasspath)
}
}
}
Related Issues
Deliverables
- Configure test source sets in the Eclipse classpath.
- Update wiki.
No further details from SPR-17004
Comment From: sbrannen
Closing since this is no longer valid.