42 lines
1.4 KiB
Groovy
42 lines
1.4 KiB
Groovy
plugins {
|
|
id "com.github.bjornvester.xjc"
|
|
}
|
|
|
|
description = "Spring Object/XML Marshalling"
|
|
|
|
xjc {
|
|
xsdDir.set(layout.projectDirectory.dir("src/test/schema"))
|
|
defaultPackage.set('org.springframework.oxm.jaxb.test')
|
|
}
|
|
|
|
dependencies {
|
|
api(project(":spring-beans"))
|
|
api(project(":spring-core"))
|
|
optional("com.thoughtworks.xstream:xstream")
|
|
optional("jakarta.activation:jakarta.activation-api")
|
|
optional("jakarta.xml.bind:jakarta.xml.bind-api")
|
|
testImplementation(project(":spring-context"))
|
|
testImplementation(testFixtures(project(":spring-core")))
|
|
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
|
|
|
|
sourceSets.test.java.srcDir(xjc.outputJavaDir)
|
|
sourceSets.test.resources.srcDir(xjc.outputResourcesDir)
|
|
}
|