Fix buildSrc Eclipse import issues

Update `buildSrc` so that it imports cleanly into Eclipse with tests
that can run inside the IDE.

Fixes gh-40041
This commit is contained in:
Phillip Webb 2024-03-19 22:24:58 -07:00
parent ecf89c3fe3
commit 4aa4e14fa4
1 changed files with 14 additions and 4 deletions

View File

@ -65,6 +65,12 @@ dependencies {
testRuntimeOnly("org.junit.platform:junit-platform-launcher") testRuntimeOnly("org.junit.platform:junit-platform-launcher")
} }
configurations.all {
exclude group:"org.slf4j", module:"slf4j-api"
exclude group:"ch.qos.logback", module:"logback-classic"
exclude group:"ch.qos.logback", module:"logback-core"
}
gradlePlugin { gradlePlugin {
plugins { plugins {
annotationProcessorPlugin { annotationProcessorPlugin {
@ -134,8 +140,12 @@ test {
useJUnitPlatform() useJUnitPlatform()
} }
eclipse.classpath.file.whenMerged { eclipse {
def jreEntry = entries.find { it.path.contains("org.eclipse.jdt.launching.JRE_CONTAINER") } jdt {
jreEntry.entryAttributes['module'] = 'true' file {
jreEntry.entryAttributes['limit-modules'] = 'java.base' withProperties {
it["org.eclipse.jdt.core.compiler.ignoreUnnamedModuleForSplitPackage"] = "enabled"
}
}
}
} }