2021-05-03 20:52:28 +08:00
|
|
|
plugins {
|
2024-07-24 17:11:12 +08:00
|
|
|
id "com.github.bjornvester.xjc"
|
2021-05-03 20:52:28 +08:00
|
|
|
}
|
|
|
|
|
2017-08-21 20:41:55 +08:00
|
|
|
description = "Spring Object/XML Marshalling"
|
|
|
|
|
2021-05-03 20:52:28 +08:00
|
|
|
xjc {
|
2024-07-23 21:24:30 +08:00
|
|
|
xsdDir.set(layout.projectDirectory.dir("src/test/schema"))
|
|
|
|
defaultPackage.set('org.springframework.oxm.jaxb.test')
|
2012-01-18 01:22:24 +08:00
|
|
|
}
|
|
|
|
|
2017-08-21 20:41:55 +08:00
|
|
|
dependencies {
|
2021-05-22 03:16:30 +08:00
|
|
|
api(project(":spring-beans"))
|
|
|
|
api(project(":spring-core"))
|
2019-08-27 03:13:12 +08:00
|
|
|
optional("com.thoughtworks.xstream:xstream")
|
2023-08-02 06:56:50 +08:00
|
|
|
optional("jakarta.activation:jakarta.activation-api")
|
|
|
|
optional("jakarta.xml.bind:jakarta.xml.bind-api")
|
2021-05-22 03:16:30 +08:00
|
|
|
testImplementation(project(":spring-context"))
|
|
|
|
testImplementation(testFixtures(project(":spring-core")))
|
|
|
|
testImplementation("org.codehaus.jettison:jettison") {
|
2018-08-16 21:32:44 +08:00
|
|
|
exclude group: "stax", module: "stax-api"
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
2021-05-22 03:16:30 +08:00
|
|
|
testImplementation("org.xmlunit:xmlunit-assertj")
|
|
|
|
testImplementation("org.xmlunit:xmlunit-matchers")
|
|
|
|
testRuntimeOnly("com.sun.xml.bind:jaxb-core")
|
|
|
|
testRuntimeOnly("com.sun.xml.bind:jaxb-impl")
|
2017-08-21 20:42:12 +08:00
|
|
|
}
|
2024-07-23 21:24:30 +08:00
|
|
|
|
|
|
|
tasks.named("xjc").configure { xjc ->
|
2024-07-26 21:39:40 +08:00
|
|
|
// 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)
|
|
|
|
}
|
2024-07-23 21:24:30 +08:00
|
|
|
sourceSets.test.java.srcDir(xjc.outputJavaDir)
|
|
|
|
sourceSets.test.resources.srcDir(xjc.outputResourcesDir)
|
|
|
|
}
|