2010-10-08 21:51:41 -04:00
|
|
|
apply plugin: 'antlr'
|
2013-05-10 16:28:03 -04:00
|
|
|
apply plugin: 'hibernate-matrix-testing'
|
|
|
|
|
2013-09-10 17:07:39 -04:00
|
|
|
apply plugin: 'version-injection'
|
2013-05-10 16:28:03 -04:00
|
|
|
|
2013-09-10 17:07:39 -04:00
|
|
|
versionInjection {
|
|
|
|
into( 'org.hibernate.Version', 'getVersionString' )
|
|
|
|
}
|
2010-10-08 21:51:41 -04:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile( libraries.jta )
|
2012-03-23 04:02:45 -04:00
|
|
|
compile( libraries.dom4j )
|
2014-01-27 08:47:54 -05:00
|
|
|
compile( libraries.classmate )
|
2012-03-23 04:02:45 -04:00
|
|
|
compile( libraries.commons_annotations )
|
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 )
|
2012-07-11 10:19:31 -04:00
|
|
|
compile( libraries.jandex )
|
2012-03-09 14:34:02 -05:00
|
|
|
|
2010-10-08 21:51:41 -04:00
|
|
|
antlr( libraries.antlr )
|
2012-03-09 14:34:02 -05:00
|
|
|
|
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 )
|
2012-03-09 14:34:02 -05:00
|
|
|
|
2013-11-26 18:48:25 -05:00
|
|
|
testCompile( project(':hibernate-testing') )
|
2010-10-08 21:51:41 -04:00
|
|
|
testCompile( libraries.validation )
|
2012-08-01 11:40:49 -04:00
|
|
|
testCompile( libraries.jandex )
|
|
|
|
testCompile( libraries.classmate )
|
|
|
|
testCompile( libraries.mockito )
|
2010-10-08 21:51:41 -04:00
|
|
|
testCompile( libraries.validator ) {
|
|
|
|
// for test runtime
|
|
|
|
transitive = true
|
|
|
|
}
|
2013-08-01 02:19:33 -04:00
|
|
|
// for testing stored procedure support
|
|
|
|
testCompile( libraries.derby )
|
|
|
|
|
2012-03-09 14:34:02 -05:00
|
|
|
|
2010-10-08 21:51:41 -04:00
|
|
|
testRuntime( 'jaxen:jaxen:1.1' )
|
|
|
|
testRuntime( libraries.javassist )
|
2013-05-02 13:11:35 -04:00
|
|
|
testRuntime( libraries.unified_el )
|
2010-10-08 21:51:41 -04:00
|
|
|
}
|
|
|
|
|
2013-04-16 19:25:20 -04:00
|
|
|
def pomName() {
|
|
|
|
return 'Core Hibernate O/RM functionality'
|
|
|
|
}
|
|
|
|
|
|
|
|
def pomDescription() {
|
|
|
|
return 'The core O/RM functionality as provided by Hibernate'
|
|
|
|
}
|
|
|
|
|
2013-12-02 21:53:19 -05:00
|
|
|
def osgiDescription() {
|
|
|
|
return pomDescription()
|
|
|
|
}
|
|
|
|
|
2014-04-04 18:22:13 -04:00
|
|
|
test {
|
|
|
|
// putting this in test {} *should* indicate it is only in effect for H2 run
|
|
|
|
// using parallel runs for non-in-memory databases could cause contention issues.
|
|
|
|
maxParallelForks = 5;
|
|
|
|
forkEvery = 200;
|
|
|
|
|
2014-03-27 08:17:25 -04:00
|
|
|
// testLogging {
|
|
|
|
// // make test events logged as LIFECYCLE so they show up in console
|
|
|
|
// // this, e.g., allows us to see the name of each test as Gradle starts
|
|
|
|
// // it, so we can see where (if) the build hangs in tests
|
|
|
|
// events "started", "skipped", "failed"
|
|
|
|
// }
|
2014-04-04 18:22:13 -04:00
|
|
|
}
|
2014-03-27 08:16:25 -04:00
|
|
|
|
2013-01-23 18:22:03 -05:00
|
|
|
jar {
|
|
|
|
manifest {
|
2013-09-10 17:07:39 -04:00
|
|
|
mainAttributes( 'Main-Class': 'org.hibernate.Version' )
|
|
|
|
|
2013-06-12 16:50:06 -04:00
|
|
|
instructionFirst 'Import-Package',
|
2013-03-11 12:15:34 -04:00
|
|
|
'javax.security.auth;resolution:=optional',
|
|
|
|
'javax.security.jacc;resolution:=optional',
|
|
|
|
'javax.validation;resolution:=optional',
|
|
|
|
'javax.validation.constraints;resolution:=optional',
|
|
|
|
'javax.validation.groups;resolution:=optional',
|
|
|
|
'javax.validation.metadata;resolution:=optional',
|
2013-04-08 18:53:44 -04:00
|
|
|
// TODO: Shouldn't have to explicitly list this, but the plugin
|
|
|
|
// generates it with a [1.0,2) version.
|
|
|
|
'javax.persistence;version="2.1.0"',
|
|
|
|
// Temporarily support JTA 1.1 -- Karaf and other frameworks still
|
|
|
|
// use it. Without this, the plugin generates [1.2,2).
|
|
|
|
// build.gradle adds javax.transaction for all modules
|
2013-06-07 13:05:36 -04:00
|
|
|
'javax.transaction.xa;version="[1.1,2)"',
|
|
|
|
// optionals
|
|
|
|
'javax.management;resolution:=optional',
|
|
|
|
'javax.naming.event;resolution:=optional',
|
|
|
|
'javax.naming.spi;resolution:=optional',
|
|
|
|
'org.apache.tools.ant;resolution:=optional',
|
|
|
|
'org.apache.tools.ant.taskdefs;resolution:=optional',
|
|
|
|
'org.apache.tools.ant.types;resolution:=optional'
|
2013-03-11 12:15:34 -04:00
|
|
|
|
2013-11-26 11:43:50 -05:00
|
|
|
// // TODO: Uncomment once EntityManagerFactoryBuilderImpl no longer
|
|
|
|
// // uses ClassLoaderServiceImpl.
|
|
|
|
// instruction 'Export-Package',
|
|
|
|
// 'org.hibernate.boot.registry.classloading.internal',
|
|
|
|
// '*'
|
2013-01-23 18:22:03 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-02 21:53:19 -05:00
|
|
|
ext {
|
|
|
|
jaxbTargetDir = file( "${buildDir}/generated-src/jaxb/main" )
|
|
|
|
}
|
|
|
|
|
2011-04-01 12:02:07 -04:00
|
|
|
sourceSets.main {
|
|
|
|
java.srcDir jaxbTargetDir
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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 {
|
2013-04-17 14:26:55 -04:00
|
|
|
sourceDirs += file( "${buildDir}/generated-src/antlr/main" )
|
2012-02-15 17:31:29 -05:00
|
|
|
}
|
2010-10-10 16:06:06 -04:00
|
|
|
}
|
|
|
|
|
2011-05-04 16:49:57 -04:00
|
|
|
task jaxb {
|
2012-08-08 05:09:11 -04:00
|
|
|
ext {
|
2012-08-22 14:41:16 -04:00
|
|
|
// input schemas
|
|
|
|
cfgXsd = file( 'src/main/resources/org/hibernate/hibernate-configuration-4.0.xsd')
|
2014-02-08 16:57:27 -05:00
|
|
|
hbmXsd = file( 'src/main/resources/org/hibernate/xsd/mapping/legacy-mapping-4.0.xsd' )
|
|
|
|
unifiedOrmXsd = file( 'src/main/resources/org/hibernate/xsd/mapping/mapping-2.1.0.xsd' )
|
2012-08-22 14:41:16 -04:00
|
|
|
|
|
|
|
// input bindings
|
|
|
|
cfgXjb = file( 'src/main/xjb/hbm-configuration-bindings.xjb' )
|
|
|
|
hbmXjb = file( 'src/main/xjb/hbm-mapping-bindings.xjb' )
|
2014-02-07 17:55:16 -05:00
|
|
|
unifiedOrmXjb = file( 'src/main/xjb/mapping-bindings.xjb' )
|
2012-08-22 14:41:16 -04:00
|
|
|
}
|
|
|
|
|
2011-05-04 16:49:57 -04:00
|
|
|
// configure Gradle up-to-date checking
|
2014-02-10 02:00:19 -05:00
|
|
|
// inputs.files( [cfgXsd, hbmXsd, ormXsd, unifiedOrmXsd, cfgXjb, hbmXjb, ormXjb, unifiedOrmXjb] )
|
|
|
|
inputs.files( [cfgXsd, hbmXsd, unifiedOrmXsd, cfgXjb, hbmXjb, unifiedOrmXjb] )
|
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}',
|
2014-01-27 08:47:54 -05:00
|
|
|
package: 'org.hibernate.jaxb.spi.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}',
|
2014-02-08 16:57:27 -05:00
|
|
|
binding: 'src/main/xjb/hbm-mapping-bindings.xjb',
|
2011-07-06 05:44:58 -04:00
|
|
|
schema: hbmXsd.path,
|
|
|
|
extension: 'true'
|
|
|
|
) {
|
2014-01-27 08:47:54 -05:00
|
|
|
arg line: '-Xinheritance -Xsimplify'
|
2011-07-06 05:44:58 -04:00
|
|
|
}
|
2011-05-04 16:49:57 -04:00
|
|
|
|
2014-02-07 17:55:16 -05:00
|
|
|
// unified mapping xsd
|
|
|
|
ant.xjc(
|
|
|
|
destdir: '${jaxbTargetDir}',
|
|
|
|
binding: 'src/main/xjb/mapping-bindings.xjb',
|
|
|
|
schema: unifiedOrmXsd.path,
|
|
|
|
extension: 'true'
|
|
|
|
) {
|
|
|
|
arg line: '-Xinheritance'
|
|
|
|
}
|
|
|
|
|
2011-03-29 07:58:17 -04:00
|
|
|
}
|
2011-05-04 16:49:57 -04:00
|
|
|
|
2011-03-29 07:58:17 -04:00
|
|
|
}
|
2013-04-04 15:30:53 -04:00
|
|
|
|
2014-05-08 12:40:51 -04:00
|
|
|
sourceSets.main.sourceGeneratorsTask.dependsOn jaxb
|
|
|
|
sourceSets.main.sourceGeneratorsTask.dependsOn generateGrammarSource
|