2010-10-08 21:51:41 -04:00
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'antlr'
|
2011-03-21 21:33:19 -04:00
|
|
|
apply plugin: org.hibernate.build.gradle.inject.InjectionPlugin
|
2012-01-03 21:43:15 -05:00
|
|
|
apply plugin: org.hibernate.build.gradle.testing.matrix.MatrixTestingPlugin
|
2010-10-08 21:51:41 -04:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile( libraries.jta )
|
|
|
|
compile( libraries.dom4j ) {
|
|
|
|
transitive = false
|
|
|
|
}
|
2011-11-14 04:12:51 -05:00
|
|
|
compile( libraries.commons_annotations ) {
|
|
|
|
transitive = false
|
|
|
|
}
|
2010-10-08 21:51:41 -04:00
|
|
|
compile( libraries.jpa )
|
2011-03-29 16:14:09 -04:00
|
|
|
compile( libraries.javassist )
|
2011-06-08 12:12:56 -04:00
|
|
|
compile( libraries.antlr )
|
2010-10-08 21:51:41 -04:00
|
|
|
antlr( libraries.antlr )
|
2011-12-28 00:11:18 -05:00
|
|
|
provided( libraries.jandex )
|
|
|
|
provided( libraries.classmate )
|
2010-10-08 21:51:41 -04:00
|
|
|
provided( libraries.ant )
|
2011-02-25 12:41:52 -05:00
|
|
|
provided( libraries.jacc )
|
2010-10-08 21:51:41 -04:00
|
|
|
provided( libraries.validation )
|
2011-03-07 17:20:53 -05:00
|
|
|
testCompile( project(':hibernate-testing') )
|
2010-10-08 21:51:41 -04:00
|
|
|
testCompile( libraries.validation )
|
2011-12-28 00:11:18 -05:00
|
|
|
testCompile( libraries.jandex )
|
|
|
|
testCompile( libraries.classmate )
|
2010-10-08 21:51:41 -04:00
|
|
|
testCompile( libraries.validator ) {
|
|
|
|
// for test runtime
|
|
|
|
transitive = true
|
|
|
|
}
|
|
|
|
testRuntime( 'jaxen:jaxen:1.1' )
|
|
|
|
testRuntime( libraries.javassist )
|
2011-12-28 00:11:18 -05:00
|
|
|
|
2010-10-08 21:51:41 -04:00
|
|
|
}
|
2011-11-20 21:16:30 -05:00
|
|
|
compileMatrixJava.options.define(compilerArgs: ["-proc:none", "-encoding", "UTF-8"])
|
2010-10-08 21:51:41 -04:00
|
|
|
|
|
|
|
manifest.mainAttributes(
|
|
|
|
'Main-Class': 'org.hibernate.Version'
|
|
|
|
)
|
2011-08-30 03:20:51 -04:00
|
|
|
sourceSets {
|
|
|
|
matrix {
|
|
|
|
java {
|
|
|
|
srcDir 'src/matrix/java'
|
|
|
|
}
|
|
|
|
resources {
|
|
|
|
srcDir 'src/matrix/resources'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-04-01 12:02:07 -04:00
|
|
|
sourceSets.main {
|
2011-04-11 18:43:43 -04:00
|
|
|
jaxbTargetDir = file( "${buildDir}/generated-src/jaxb/main" )
|
2011-04-01 12:02:07 -04:00
|
|
|
java.srcDir jaxbTargetDir
|
2011-11-01 02:53:31 -04:00
|
|
|
originalJavaSrcDirs = java.srcDirs
|
2011-04-01 12:02:07 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// resources inherently exclude sources
|
|
|
|
sourceSets.test.resources {
|
|
|
|
setSrcDirs( ['src/test/java','src/test/resources'] )
|
2010-10-08 21:51:41 -04:00
|
|
|
}
|
|
|
|
|
2012-02-15 17:31:29 -05:00
|
|
|
idea {
|
|
|
|
module {
|
|
|
|
sourceDirs += file( '$buildDir/generated-src/antlr/main' )
|
|
|
|
testSourceDirs += file( 'src/matrix/java')
|
|
|
|
testSourceDirs += file( 'src/matrix/resources')
|
|
|
|
}
|
2010-10-10 16:06:06 -04:00
|
|
|
}
|
|
|
|
|
2011-05-04 16:49:57 -04:00
|
|
|
task jaxb {
|
|
|
|
// output directory
|
2011-04-11 18:43:43 -04:00
|
|
|
jaxbTargetDir = file( "${buildDir}/generated-src/jaxb/main" )
|
2011-03-29 07:58:17 -04:00
|
|
|
|
2011-05-04 16:49:57 -04:00
|
|
|
// input schemas
|
|
|
|
cfgXsd = file( 'src/main/resources/org/hibernate/hibernate-configuration-4.0.xsd')
|
|
|
|
hbmXsd = file( 'src/main/resources/org/hibernate/hibernate-mapping-4.0.xsd' )
|
|
|
|
ormXsd = file( 'src/main/resources/org/hibernate/ejb/orm_2_0.xsd' )
|
2011-04-11 12:51:41 -04:00
|
|
|
|
2011-07-06 05:44:58 -04:00
|
|
|
// input bindings
|
|
|
|
cfgXjb = file( 'src/main/xjb/hbm-configuration-bindings.xjb' )
|
|
|
|
hbmXjb = file( 'src/main/xjb/hbm-mapping-bindings.xjb' )
|
|
|
|
ormXjb = file( 'src/main/xjb/orm-bindings.xjb' )
|
|
|
|
|
2011-05-04 16:49:57 -04:00
|
|
|
// configure Gradle up-to-date checking
|
2011-07-06 05:44:58 -04:00
|
|
|
inputs.files( [cfgXsd, hbmXsd, ormXsd, cfgXjb, hbmXjb, ormXjb] )
|
2011-05-04 16:49:57 -04:00
|
|
|
outputs.dir( jaxbTargetDir )
|
|
|
|
|
|
|
|
// perform actions
|
|
|
|
doLast {
|
|
|
|
jaxbTargetDir.mkdirs()
|
|
|
|
|
2011-07-06 05:44:58 -04:00
|
|
|
ant.taskdef(name: 'xjc', classname: 'org.jvnet.jaxb2_commons.xjc.XJC2Task', classpath: configurations.jaxb.asPath)
|
2011-05-04 16:49:57 -04:00
|
|
|
ant.jaxbTargetDir = jaxbTargetDir
|
|
|
|
|
|
|
|
// hibernate-configuration
|
|
|
|
ant.xjc(
|
|
|
|
destdir: '${jaxbTargetDir}',
|
2011-09-13 21:08:42 -04:00
|
|
|
package: 'org.hibernate.internal.jaxb.cfg',
|
2011-05-04 16:49:57 -04:00
|
|
|
binding: 'src/main/xjb/hbm-configuration-bindings.xjb',
|
|
|
|
schema: cfgXsd.path
|
|
|
|
)
|
|
|
|
|
|
|
|
// hibernate-mapping
|
|
|
|
ant.xjc(
|
|
|
|
destdir: '${jaxbTargetDir}',
|
2011-09-13 21:08:42 -04:00
|
|
|
package: 'org.hibernate.internal.jaxb.mapping.hbm',
|
2011-07-06 05:44:58 -04:00
|
|
|
binding: hbmXjb.path,
|
|
|
|
schema: hbmXsd.path,
|
|
|
|
extension: 'true'
|
|
|
|
) {
|
|
|
|
arg line: '-Xinheritance'
|
|
|
|
}
|
2011-05-04 16:49:57 -04:00
|
|
|
|
|
|
|
// orm.xml (jpa)
|
|
|
|
ant.xjc(
|
|
|
|
destdir: '${jaxbTargetDir}',
|
2011-09-13 21:08:42 -04:00
|
|
|
package: 'org.hibernate.internal.jaxb.mapping.orm',
|
2011-05-04 16:49:57 -04:00
|
|
|
binding: 'src/main/xjb/orm-bindings.xjb',
|
|
|
|
schema: ormXsd.path
|
|
|
|
)
|
2011-03-29 07:58:17 -04:00
|
|
|
}
|
2011-05-04 16:49:57 -04:00
|
|
|
|
2011-03-29 07:58:17 -04:00
|
|
|
}
|
2011-11-01 02:53:31 -04:00
|
|
|
generateMainLoggingClasses.dependsOn jaxb
|
|
|
|
generateMainLoggingClasses.dependsOn generateGrammarSource
|
2011-03-29 07:58:17 -04:00
|
|
|
compileJava.dependsOn jaxb
|
|
|
|
|
|
|
|
|