Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure Eclipse test source sets in Gradle build [SPR-17004] #21542

Open
spring-issuemaster opened this issue Jul 4, 2018 · 0 comments
Open

Configure Eclipse test source sets in Gradle build [SPR-17004] #21542

spring-issuemaster opened this issue Jul 4, 2018 · 0 comments
Labels
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Jul 4, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.