69 lines
1.7 KiB
Groovy
69 lines
1.7 KiB
Groovy
/*
|
|
* Hibernate, Relational Persistence for Idiomatic Java
|
|
*
|
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
|
*/
|
|
|
|
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
|
apply plugin: 'version-injection'
|
|
apply plugin: 'org.hibernate.build.gradle.xjc'
|
|
|
|
description = 'Annotation Processor to generate JPA 2 static metamodel classes'
|
|
|
|
ext {
|
|
xjcTargetDir = file( "${buildDir}/generated-src/xjc/main" )
|
|
xsdDir = file( "${projectDir}/src/main/xsd" )
|
|
}
|
|
|
|
dependencies {
|
|
compile( libraries.jaxb_api )
|
|
|
|
xjc( libraries.jaxb_runtime )
|
|
xjc( libraries.jaxb_xjc )
|
|
xjc( libraries.jaxb2_basics )
|
|
xjc( libraries.jaxb2_basics_ant )
|
|
xjc( libraries.activation )
|
|
|
|
testCompile libraries.junit
|
|
testCompile libraries.jpa
|
|
testCompile project( ':hibernate-core' )
|
|
}
|
|
|
|
sourceSets.main {
|
|
java.srcDir xjcTargetDir
|
|
resources.srcDir xsdDir
|
|
}
|
|
|
|
compileTestJava {
|
|
options.compilerArgs += [
|
|
"-proc:none"
|
|
]
|
|
}
|
|
|
|
|
|
task jaxb {
|
|
// configure Gradle up-to-date checking
|
|
inputs.dir( xsdDir )
|
|
outputs.dir( xjcTargetDir )
|
|
|
|
// perform actions
|
|
doLast {
|
|
xjcTargetDir.mkdirs()
|
|
|
|
ant.taskdef(name: 'xjc', classname: 'org.jvnet.jaxb2_commons.xjc.XJC2Task', classpath: configurations.xjc.asPath)
|
|
|
|
ant.xjc(
|
|
destdir: ( xjcTargetDir as File ).absolutePath,
|
|
package: 'org.hibernate.jpamodelgen.xml.jaxb',
|
|
extension: 'true'
|
|
) {
|
|
schema ( dir: xsdDir.path, includes: "*.xsd" )
|
|
}
|
|
}
|
|
}
|
|
tasks.compileJava.dependsOn jaxb
|
|
|
|
checkstyleMain.exclude '**/jaxb/**'
|
|
|