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