2015-05-19 00:23:35 -04:00
|
|
|
/*
|
|
|
|
* 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>.
|
|
|
|
*/
|
2018-01-10 16:06:58 -05:00
|
|
|
|
2020-04-06 13:21:11 -04:00
|
|
|
description = 'Annotation Processor to generate JPA 2 static metamodel classes'
|
|
|
|
|
2018-01-10 16:06:58 -05:00
|
|
|
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
2013-10-25 15:27:45 -04:00
|
|
|
apply plugin: 'version-injection'
|
2015-04-09 22:42:42 -04:00
|
|
|
apply plugin: 'org.hibernate.build.gradle.xjc'
|
2013-10-25 15:27:45 -04:00
|
|
|
|
|
|
|
|
2013-11-24 16:16:12 -05:00
|
|
|
ext {
|
2015-04-09 22:42:42 -04:00
|
|
|
xjcTargetDir = file( "${buildDir}/generated-src/xjc/main" )
|
2013-11-24 16:16:12 -05:00
|
|
|
xsdDir = file( "${projectDir}/src/main/xsd" )
|
2013-10-25 15:27:45 -04:00
|
|
|
}
|
|
|
|
|
2018-01-10 16:06:58 -05:00
|
|
|
dependencies {
|
2018-10-15 04:55:56 -04:00
|
|
|
|
2018-11-29 04:32:47 -05:00
|
|
|
// JAXB
|
|
|
|
compile( libraries.jaxb_api )
|
|
|
|
compile( libraries.jaxb_runtime )
|
2018-10-15 06:15:41 -04:00
|
|
|
xjc( libraries.jaxb_runtime )
|
|
|
|
xjc( libraries.jaxb_xjc )
|
|
|
|
xjc( libraries.jaxb2_basics )
|
|
|
|
xjc( libraries.jaxb2_basics_ant )
|
|
|
|
xjc( libraries.activation )
|
2018-01-22 13:37:23 -05:00
|
|
|
|
2018-10-15 06:15:41 -04:00
|
|
|
testCompile libraries.junit
|
|
|
|
testCompile libraries.jpa
|
|
|
|
testCompile project( ':hibernate-core' )
|
2018-01-10 16:06:58 -05:00
|
|
|
}
|
|
|
|
|
2013-10-25 15:27:45 -04:00
|
|
|
sourceSets.main {
|
2015-04-09 22:42:42 -04:00
|
|
|
java.srcDir xjcTargetDir
|
2013-11-24 16:16:12 -05:00
|
|
|
resources.srcDir xsdDir
|
2013-10-25 15:27:45 -04:00
|
|
|
}
|
|
|
|
|
2013-11-22 20:46:05 -05:00
|
|
|
compileTestJava {
|
|
|
|
options.compilerArgs += [
|
|
|
|
"-proc:none"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2013-10-25 15:27:45 -04:00
|
|
|
|
|
|
|
task jaxb {
|
|
|
|
// configure Gradle up-to-date checking
|
2013-11-24 16:16:12 -05:00
|
|
|
inputs.dir( xsdDir )
|
2015-04-09 22:42:42 -04:00
|
|
|
outputs.dir( xjcTargetDir )
|
2013-10-25 15:27:45 -04:00
|
|
|
|
|
|
|
// perform actions
|
|
|
|
doLast {
|
2015-04-09 22:42:42 -04:00
|
|
|
xjcTargetDir.mkdirs()
|
2013-10-25 15:27:45 -04:00
|
|
|
|
2015-04-09 22:42:42 -04:00
|
|
|
ant.taskdef(name: 'xjc', classname: 'org.jvnet.jaxb2_commons.xjc.XJC2Task', classpath: configurations.xjc.asPath)
|
2013-10-25 15:27:45 -04:00
|
|
|
|
|
|
|
ant.xjc(
|
2015-04-09 22:42:42 -04:00
|
|
|
destdir: ( xjcTargetDir as File ).absolutePath,
|
2013-10-25 15:27:45 -04:00
|
|
|
package: 'org.hibernate.jpamodelgen.xml.jaxb',
|
|
|
|
extension: 'true'
|
|
|
|
) {
|
2013-11-24 16:16:12 -05:00
|
|
|
schema ( dir: xsdDir.path, includes: "*.xsd" )
|
2013-10-25 15:27:45 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-04-09 22:42:42 -04:00
|
|
|
tasks.compileJava.dependsOn jaxb
|
2013-10-25 15:27:45 -04:00
|
|
|
|
|
|
|
checkstyleMain.exclude '**/jaxb/**'
|
|
|
|
|