HHH-9717 - Build script improvements - applied new standalone XJC and AnimalSniffer plugins

This commit is contained in:
Steve Ebersole 2015-04-09 21:42:42 -05:00
parent 6e7357beeb
commit da06b22dee
2 changed files with 9 additions and 9 deletions

View File

@ -25,7 +25,7 @@ buildscript {
classpath 'org.hibernate.build.gradle:hibernate-matrix-testing:1.0.0-SNAPSHOT'
classpath 'org.hibernate.build.gradle:version-injection-plugin:1.0.0'
classpath 'org.hibernate.build.gradle:gradle-animalSniffer-plugin:1.0.1.Final'
classpath 'org.hibernate.build.gradle:gradle-xjc-plugin:1.0.0.Final'
classpath 'org.hibernate.build.gradle:gradle-xjc-plugin:1.0.2.Final'
}
}

View File

@ -1,4 +1,5 @@
apply plugin: 'version-injection'
apply plugin: 'org.hibernate.build.gradle.xjc'
dependencies {
testCompile libraries.junit
@ -21,12 +22,12 @@ versionInjection {
}
ext {
jaxbTargetDir = file( "${buildDir}/generated-sources/jaxb/main" )
xjcTargetDir = file( "${buildDir}/generated-src/xjc/main" )
xsdDir = file( "${projectDir}/src/main/xsd" )
}
sourceSets.main {
java.srcDir jaxbTargetDir
java.srcDir xjcTargetDir
resources.srcDir xsdDir
}
@ -46,17 +47,16 @@ jar {
task jaxb {
// configure Gradle up-to-date checking
inputs.dir( xsdDir )
outputs.dir( jaxbTargetDir )
outputs.dir( xjcTargetDir )
// perform actions
doLast {
jaxbTargetDir.mkdirs()
xjcTargetDir.mkdirs()
ant.taskdef(name: 'xjc', classname: 'org.jvnet.jaxb2_commons.xjc.XJC2Task', classpath: configurations.jaxb.asPath)
ant.jaxbTargetDir = jaxbTargetDir
ant.taskdef(name: 'xjc', classname: 'org.jvnet.jaxb2_commons.xjc.XJC2Task', classpath: configurations.xjc.asPath)
ant.xjc(
destdir: '${jaxbTargetDir}',
destdir: ( xjcTargetDir as File ).absolutePath,
package: 'org.hibernate.jpamodelgen.xml.jaxb',
extension: 'true'
) {
@ -64,7 +64,7 @@ task jaxb {
}
}
}
runSourceGenerators.dependsOn jaxb
tasks.compileJava.dependsOn jaxb
checkstyleMain.exclude '**/jaxb/**'