-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
hibernate-entitymanager.gradle
executable file
·114 lines (96 loc) · 3.97 KB
/
hibernate-entitymanager.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
* 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>.
*/
import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'hibernate-matrix-testing'
configurations {
hibernateJpaModelGenTool {
description = "Dependencies for running the Hibernate JPA Metamodel Generator AnnotationProcessor tool"
}
tests {
description = 'Configuration for the produced test jar'
}
}
dependencies {
compile( project(':hibernate-core') )
compile( libraries.dom4j )
compile( libraries.commons_annotations )
compile( libraries.jpa )
compile( libraries.javassist )
compile( libraries.jta )
provided( "javax.enterprise:cdi-api:1.1-PFD" )
testCompile( project(':hibernate-testing') )
testCompile( libraries.shrinkwrap_api )
testCompile( libraries.shrinkwrap )
testCompile( libraries.validation )
testCompile( "org.jboss.weld:weld-core:2.0.0.Beta6" )
testCompile( "org.jboss.weld.arquillian.container:arquillian-weld-ee-embedded-1.1:1.1.2.Final" )
testCompile( "javax.enterprise:cdi-api:1.1-PFD" ) {
// we need to force it to make sure we influence the one coming from arquillian
force=true
}
testCompile( libraries.mockito )
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" )
// for testing stored procedure support
testCompile( libraries.derby )
testCompile( 'joda-time:joda-time:2.3' )
testCompile( project( ':hibernate-jpamodelgen' ) )
}
mavenPom {
name = 'Hibernate JPA Support'
description = 'Hibernate O/RM implementation of the JPA specification'
}
public String osgiDescription() {
return mavenPom.description
}
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.
instructionFirst 'Import-Package',
'!javax.enterprise*',
'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"',
'javax.persistence.spi;version="2.1.0"'
}
}
//addMetaGenProcessor( sourceSets.test )
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Process 'bundle resources' for the packaging tests
////////////////////////////////////////////////////////////////////////////////////////////////////////
task copyBundleResources (type: Copy) {
ext.bundlesTargetDir = file( "${buildDir}/bundles" )
from file('src/test/bundles')
into bundlesTargetDir
ext.bundleTokens = dbBundle[db]
ext.bundleTokens["buildDirName"] = buildDir.absolutePath
filter(ReplaceTokens, tokens: bundleTokens);
doFirst {
bundlesTargetDir.mkdirs()
}
}
processTestResources.dependsOn copyBundleResources
// 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'
from sourceSets.test.output
}
artifacts {
tests testJar
}