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-projects-issues opened this issue Jul 4, 2018 · 0 comments
Open
Labels
type: task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues 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

@spring-projects-issues spring-projects-issues added the type: task label Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.x Backlog milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task
Projects
None yet
Development

No branches or pull requests

1 participant