Skip to content

Commit

Permalink
Merge branch '6.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Jul 26, 2024
2 parents de2335b + 5aa3883 commit 94e2bef
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
13 changes: 13 additions & 0 deletions gradle/ide.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ eclipse.classpath.file.whenMerged {
}
}

// Due to an apparent bug in Gradle, even though we exclude the "main" classpath
// entries for sources generated by XJC in spring-oxm.gradle, the Gradle eclipse
// plugin still includes them in the generated .classpath file. So, we have to
// manually remove those lingering "main" entries.
if (project.name == "spring-oxm") {
eclipse.classpath.file.whenMerged { classpath ->
classpath.entries.removeAll {
it.path =~ /build\/generated\/sources\/xjc\/.+/ &&
it.entryAttributes.get("gradle_scope") == "main"
}
}
}

// Include project specific settings
task eclipseSettings(type: Copy) {
from rootProject.files(
Expand Down
16 changes: 7 additions & 9 deletions spring-oxm/spring-oxm.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,20 @@ dependencies {
testImplementation("org.codehaus.jettison:jettison") {
exclude group: "stax", module: "stax-api"
}
//testImplementation(files(genJaxb.classesDir).builtBy(genJaxb))
testImplementation("org.xmlunit:xmlunit-assertj")
testImplementation("org.xmlunit:xmlunit-matchers")
testRuntimeOnly("com.sun.xml.bind:jaxb-core")
testRuntimeOnly("com.sun.xml.bind:jaxb-impl")
}

tasks.named("xjc").configure { xjc ->
// XJC plugin only works against main sources
def javaSrcDirs = sourceSets.main.java.srcDirs
javaSrcDirs.remove(file(xjc.outputJavaDir))
sourceSets.main.java.srcDirs = javaSrcDirs
def resourcesSrcDirs = sourceSets.main.resources.srcDirs
resourcesSrcDirs.remove(file(xjc.outputResourcesDir))
sourceSets.main.resources.srcDirs = resourcesSrcDirs

// XJC plugin only works against main sources, so we have to "move" them to test sources.
sourceSets.main.java.exclude {
it.file.absolutePath.startsWith(outputJavaDir.get().asFile.absolutePath)
}
sourceSets.main.resources.exclude {
it.file.absolutePath.startsWith(outputResourcesDir.get().asFile.absolutePath)
}
sourceSets.test.java.srcDir(xjc.outputJavaDir)
sourceSets.test.resources.srcDir(xjc.outputResourcesDir)
}

0 comments on commit 94e2bef

Please sign in to comment.