2011-03-03 12:53:20 -05:00
|
|
|
import org.apache.tools.ant.filters.ReplaceTokens
|
2010-10-09 14:02:49 -04:00
|
|
|
|
2013-05-10 16:28:03 -04:00
|
|
|
apply plugin: 'hibernate-matrix-testing'
|
2011-12-16 10:12:45 -05:00
|
|
|
|
2013-11-18 16:36:23 -05:00
|
|
|
configurations {
|
|
|
|
hibernateJpaModelGenTool {
|
|
|
|
description = "Dependencies for running the Hibernate JPA Metamodel Generator AnnotationProcessor tool"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-16 10:12:45 -05:00
|
|
|
dependencies {
|
2010-10-09 14:02:49 -04:00
|
|
|
compile( project(':hibernate-core') )
|
|
|
|
compile( libraries.dom4j )
|
|
|
|
compile( libraries.commons_annotations )
|
|
|
|
compile( libraries.jpa )
|
|
|
|
compile( libraries.jta )
|
|
|
|
compile( libraries.javassist )
|
2013-03-25 16:03:26 -04:00
|
|
|
|
|
|
|
provided( "javax.enterprise:cdi-api:1.1-PFD" )
|
|
|
|
|
2013-11-26 18:48:25 -05:00
|
|
|
testCompile( project(':hibernate-testing') )
|
|
|
|
testCompile( libraries.shrinkwrap_api )
|
2010-10-09 14:02:49 -04:00
|
|
|
testCompile( libraries.shrinkwrap )
|
|
|
|
testCompile( libraries.validation )
|
2013-03-25 16:03:26 -04:00
|
|
|
testCompile( "org.jboss.weld:weld-core:2.0.0.Beta6" )
|
2012-08-17 19:19:25 -04:00
|
|
|
testCompile( "org.jboss.weld.arquillian.container:arquillian-weld-ee-embedded-1.1:1.1.2.Final" )
|
2014-04-24 15:49:36 -04:00
|
|
|
testCompile( libraries.mockito )
|
2013-03-25 16:03:26 -04:00
|
|
|
|
|
|
|
testRuntime( libraries.validator )
|
|
|
|
testRuntime( "org.jboss.spec.javax.ejb:jboss-ejb-api_3.2_spec:1.0.0.Alpha2" )
|
|
|
|
// testRuntime( "org.glassfish.web:el-impl:2.1.2-b04" )
|
2013-08-01 01:18:14 -04:00
|
|
|
|
|
|
|
// for testing stored procedure support
|
2013-08-01 02:19:33 -04:00
|
|
|
testCompile( libraries.derby )
|
2013-11-18 16:36:23 -05:00
|
|
|
|
2014-01-10 10:35:27 -05:00
|
|
|
testCompile( 'joda-time:joda-time:2.3' )
|
|
|
|
|
2013-11-18 16:36:23 -05:00
|
|
|
hibernateJpaModelGenTool( project( ':hibernate-jpamodelgen' ) )
|
2010-10-09 14:02:49 -04:00
|
|
|
}
|
|
|
|
|
2013-12-02 23:11:00 -05:00
|
|
|
public String pomName() {
|
2013-04-16 19:25:20 -04:00
|
|
|
return 'Hibernate JPA Support'
|
|
|
|
}
|
|
|
|
|
2013-12-02 23:11:00 -05:00
|
|
|
public String pomDescription() {
|
2013-04-16 19:25:20 -04:00
|
|
|
return 'Hibernate O/RM implementation of the JPA specification'
|
|
|
|
}
|
|
|
|
|
2013-12-02 23:11:00 -05:00
|
|
|
public String osgiDescription() {
|
2013-12-02 21:53:19 -05:00
|
|
|
return pomDescription()
|
|
|
|
}
|
|
|
|
|
2013-01-23 18:22:03 -05:00
|
|
|
jar {
|
|
|
|
manifest {
|
|
|
|
// A cdi-api OSGi bundle does not currently exist. For now, explicitly
|
|
|
|
// ignore its packages. This will only cause issues if an app tries
|
|
|
|
// to use the BeanManagerListenerFactory functionality.
|
|
|
|
// NOTE: The "!" negates the package, keeping it out of Import-Package
|
|
|
|
// and including it in Ignore-Package. Also note that '*' does not mean
|
|
|
|
// <Import-Package>*</ImportPackage> will occur. This is simply a
|
|
|
|
// BND instruction -- the auto-discovery of imported packages still
|
|
|
|
// occurs.
|
2013-09-06 15:47:47 -04:00
|
|
|
instructionFirst 'Import-Package',
|
2013-01-23 18:22:03 -05:00
|
|
|
'!javax.enterprise*',
|
2013-04-08 18:53:44 -04:00
|
|
|
'javax.enterprise.context.spi;resolution:=optional',
|
|
|
|
'javax.enterprise.inject.spi;resolution:=optional',
|
|
|
|
// TODO: Shouldn't have to explicitly list the JPA packages, but
|
|
|
|
// the plugin generates them with [1.0,2) versions.
|
|
|
|
'javax.persistence;version="2.1.0"',
|
|
|
|
'javax.persistence.criteria;version="2.1.0"',
|
|
|
|
'javax.persistence.metamodel;version="2.1.0"',
|
2013-04-16 10:28:40 -04:00
|
|
|
'javax.persistence.spi;version="2.1.0"'
|
2013-01-23 18:22:03 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-02 23:11:00 -05:00
|
|
|
addMetaGenProcessor( sourceSets.test )
|
|
|
|
|
2011-12-25 20:59:09 -05:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2012-06-08 08:59:54 -04:00
|
|
|
// Process 'bundle resources' for the packaging tests
|
2011-12-25 20:59:09 -05:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2010-10-26 05:01:39 -04:00
|
|
|
task copyBundleResources (type: Copy) {
|
2012-08-08 05:09:11 -04:00
|
|
|
ext.bundlesTargetDir = file( "${buildDir}/bundles" )
|
2010-10-26 05:01:39 -04:00
|
|
|
from file('src/test/bundles')
|
2011-03-09 16:29:16 -05:00
|
|
|
into bundlesTargetDir
|
2010-10-26 05:01:39 -04:00
|
|
|
filter(ReplaceTokens, tokens: [
|
|
|
|
buildDirName: buildDir.absolutePath,
|
|
|
|
'db.dialect': 'org.hibernate.dialect.H2Dialect',
|
|
|
|
'jdbc.driver': 'org.h2.Driver',
|
|
|
|
'jdbc.user': 'sa',
|
|
|
|
'jdbc.pass': '',
|
|
|
|
'jdbc.url': 'jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE',
|
2011-03-09 16:29:16 -05:00
|
|
|
]);
|
|
|
|
doFirst {
|
|
|
|
bundlesTargetDir.mkdirs()
|
|
|
|
}
|
2010-10-09 14:02:49 -04:00
|
|
|
}
|
2012-06-08 09:08:13 -04:00
|
|
|
processTestResources.dependsOn copyBundleResources
|
2010-10-26 08:47:51 -04:00
|
|
|
|
2012-07-12 10:33:36 -04:00
|
|
|
// create an artifact configuration composed of the test classes so that envers can access hem test classes
|
|
|
|
task testJar(type: Jar, dependsOn: testClasses) {
|
|
|
|
classifier = 'test'
|
2012-08-08 05:09:11 -04:00
|
|
|
from sourceSets.test.output
|
2012-07-12 10:33:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
tests
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
tests testJar
|
2012-08-08 05:09:11 -04:00
|
|
|
}
|
2015-03-27 10:50:31 -04:00
|
|
|
|
|
|
|
task instrument(dependsOn: compileTestJava) << {
|
|
|
|
ant.taskdef(name: 'hibInstrument',
|
|
|
|
classname: 'org.hibernate.tool.instrument.javassist.InstrumentTask',
|
|
|
|
classpath: configurations.testCompile.asPath)
|
|
|
|
ant.hibInstrument(verbose: 'true'){
|
|
|
|
fileset(dir:"$buildDir/classes/test/org/hibernate/jpa/test/callbacks/"){
|
|
|
|
include(name: "EntityWithLazyProperty.class")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
println("hibernate instrumentation")
|
|
|
|
}
|
|
|
|
|
|
|
|
test.dependsOn instrument
|