2017-08-21 20:41:55 +08:00
|
|
|
description = "Spring Object/XML Marshalling"
|
|
|
|
|
2012-01-18 01:22:24 +08:00
|
|
|
configurations {
|
2012-12-07 04:56:24 +08:00
|
|
|
jibx
|
2017-09-27 07:34:11 +08:00
|
|
|
xjc
|
2012-01-18 01:22:24 +08:00
|
|
|
}
|
2017-01-17 21:00:15 +08:00
|
|
|
|
2012-01-18 01:22:24 +08:00
|
|
|
dependencies {
|
2017-03-25 01:01:11 +08:00
|
|
|
jibx "org.jibx:jibx-bind:1.3.1"
|
2016-07-25 20:10:46 +08:00
|
|
|
jibx "org.apache.bcel:bcel:6.0"
|
2018-11-19 19:41:26 +08:00
|
|
|
xjc "javax.xml.bind:jaxb-api:2.3.1"
|
2018-08-16 21:32:44 +08:00
|
|
|
xjc "com.sun.xml.bind:jaxb-core:2.3.0.1"
|
|
|
|
xjc "com.sun.xml.bind:jaxb-impl:2.3.0.1"
|
2018-11-19 19:41:26 +08:00
|
|
|
xjc "com.sun.xml.bind:jaxb-xjc:2.3.1"
|
2018-08-16 21:32:44 +08:00
|
|
|
xjc "com.sun.activation:javax.activation:1.2.0"
|
2012-01-18 01:22:24 +08:00
|
|
|
}
|
|
|
|
|
2012-04-14 17:37:55 +08:00
|
|
|
ext.genSourcesDir = "${buildDir}/generated-sources"
|
|
|
|
ext.flightSchema = "${projectDir}/src/test/resources/org/springframework/oxm/flight.xsd"
|
2012-01-18 01:22:24 +08:00
|
|
|
|
|
|
|
task genJaxb {
|
2012-12-07 04:56:24 +08:00
|
|
|
ext.sourcesDir = "${genSourcesDir}/jaxb"
|
|
|
|
ext.classesDir = "${buildDir}/classes/jaxb"
|
|
|
|
|
|
|
|
inputs.files flightSchema
|
|
|
|
outputs.dir classesDir
|
|
|
|
|
|
|
|
doLast() {
|
|
|
|
project.ant {
|
|
|
|
taskdef name: "xjc", classname: "com.sun.tools.xjc.XJCTask",
|
|
|
|
classpath: configurations.xjc.asPath
|
|
|
|
mkdir(dir: sourcesDir)
|
|
|
|
mkdir(dir: classesDir)
|
|
|
|
|
|
|
|
xjc(destdir: sourcesDir, schema: flightSchema,
|
|
|
|
package: "org.springframework.oxm.jaxb.test") {
|
|
|
|
produces(dir: sourcesDir, includes: "**/*.java")
|
|
|
|
}
|
|
|
|
|
2016-07-05 05:29:29 +08:00
|
|
|
javac(destdir: classesDir, source: 1.8, target: 1.8, debug: true,
|
2012-12-07 04:56:24 +08:00
|
|
|
debugLevel: "lines,vars,source",
|
2017-01-17 21:00:15 +08:00
|
|
|
classpath: configurations.xjc.asPath) {
|
2012-12-07 04:56:24 +08:00
|
|
|
src(path: sourcesDir)
|
|
|
|
include(name: "**/*.java")
|
|
|
|
include(name: "*.java")
|
|
|
|
}
|
|
|
|
|
|
|
|
copy(todir: classesDir) {
|
|
|
|
fileset(dir: sourcesDir, erroronmissingdir: false) {
|
|
|
|
exclude(name: "**/*.java")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-01-18 01:22:24 +08:00
|
|
|
}
|
|
|
|
|
2017-08-21 20:41:55 +08:00
|
|
|
dependencies {
|
|
|
|
compile(project(":spring-beans"))
|
|
|
|
compile(project(":spring-core"))
|
2018-11-19 19:41:26 +08:00
|
|
|
optional("javax.xml.bind:jaxb-api:2.3.1")
|
2018-08-17 22:01:15 +08:00
|
|
|
optional("javax.activation:javax.activation-api:1.2.0")
|
2019-07-21 00:20:03 +08:00
|
|
|
optional("com.thoughtworks.xstream:xstream:1.4.11.1") {
|
2018-08-16 21:32:44 +08:00
|
|
|
exclude group: "xpp3", module: "xpp3_min"
|
|
|
|
exclude group: "xmlpull", module: "xmlpull"
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
|
|
|
optional("org.jibx:jibx-run:1.3.1")
|
|
|
|
testCompile(project(":spring-context"))
|
|
|
|
testCompile("org.ogce:xpp3:1.1.6")
|
|
|
|
testCompile("org.codehaus.jettison:jettison:1.3.8") {
|
2018-08-16 21:32:44 +08:00
|
|
|
exclude group: "stax", module: "stax-api"
|
2017-08-21 20:41:55 +08:00
|
|
|
}
|
|
|
|
testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
|
2019-05-24 06:48:03 +08:00
|
|
|
testCompile("org.xmlunit:xmlunit-assertj:2.6.2")
|
2019-07-21 01:06:54 +08:00
|
|
|
testCompile("org.xmlunit:xmlunit-matchers:2.6.2")
|
2018-06-12 04:01:51 +08:00
|
|
|
testRuntime("com.sun.xml.bind:jaxb-core:2.3.0.1")
|
|
|
|
testRuntime("com.sun.xml.bind:jaxb-impl:2.3.0.1")
|
2017-08-21 20:42:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// JiBX compiler is currently not compatible with JDK 9
|
|
|
|
if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
|
|
|
|
compileTestJava {
|
|
|
|
def bindingXml = "${projectDir}/src/test/resources/org/springframework/oxm/jibx/binding.xml"
|
|
|
|
|
|
|
|
doLast() {
|
|
|
|
project.ant {
|
|
|
|
taskdef(name: "jibx",
|
|
|
|
classname: "org.jibx.binding.ant.CompileTask",
|
|
|
|
classpath: configurations.jibx.asPath)
|
|
|
|
|
2019-03-31 19:26:38 +08:00
|
|
|
jibx(verbose: false, load: true, binding: bindingXml) {
|
2017-08-21 20:42:12 +08:00
|
|
|
classpathset(dir: sourceSets.test.java.outputDir) {
|
|
|
|
include(name: "**/jibx/**/*")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-09-23 17:28:19 +08:00
|
|
|
}
|