-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
hibernate-orm-modules.gradle
165 lines (139 loc) · 5.67 KB
/
hibernate-orm-modules.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/*
* 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>.
*/
plugins {
id "org.wildfly.build.provision" version '0.0.11'
id "org.wildfly.build.featurepack" version '0.0.11'
}
apply from: rootProject.file( 'gradle/base-information.gradle' )
apply plugin: 'java'
apply from: rootProject.file( 'gradle/libraries.gradle' )
apply plugin: 'maven-publish'
apply plugin: 'maven-publish-auth'
apply from: rootProject.file( 'gradle/publishing-repos.gradle' )
apply from: rootProject.file( 'gradle/publishing-pom.gradle' )
apply plugin: 'build-dashboard'
apply plugin: 'project-report'
//project.tasks.jar.enabled = false
//project.tasks.javadoc.enabled = false
evaluationDependsOn( ':hibernate-core' )
evaluationDependsOn( ':hibernate-envers' )
ext {
// NOTE : `wildflyVersion` comes from libraries.gradle...
// "10" for WildFly 10.x, "11" for 11.x, etc
wildFlyMajorVersion = project.wildflyVersion.split( '\\.' )[0]
bytebuddyVersion = project.byteBuddyVersion
antlrVersion = project.antlrVersion
artifactClassifier = "wildfly-${wildFlyMajorVersion}-dist"
wildFlyInstallDir = "$rootProject.buildDir/wildfly"
fpackStagingDir = file( "target/featurepack" ) //Target build directory for the Feature Pack
}
description = "Feature Pack of Hibernate ORM modules for WildFly ${project.wildFlyMajorVersion}"
configurations {
featurePack {
description = "Dependencies to be included in the published Feature Pack"
}
provisioning {
description = "Dependencies which should be made available to the provisioning of WildFly"
}
}
repositories {
mavenLocal()
mavenCentral()
maven {
name 'jboss-public'
url 'https://repository.jboss.org/nexus/content/groups/public/'
}
}
//This builds the WildFly Feature Packs which define the Hibernate ORM modules
// # Definitions of the modules are in /module-templates
// # Versions of the included libraries are defined in the "featurePack" configuration (below)
// # See the "variables" option to replace tokens in the module definitions
// # This just creates the exploded feature pack: does NOT create a zip nor a publication, which are handled by other tasks below.
featurepack {
moduleTemplates = file( 'module-templates' ) //where to find the templates for module.xml files to generate
destinationDir = project.fpackStagingDir
configurationName 'featurePack'
// Variables to be replaced in the template. N.B. not all variables need to be replaced!
// Exact ORM version, e.g. "5.3.0.Final"
variables['slot'] = rootProject.ormVersion.fullName
// Just the minor ORM version, e.g. "5.3"; Is used as an alias for the exact version
variables['minorSlot'] = rootProject.ormVersion.family
variables['bytebuddySlot'] = antlrVersion
variables['antlrSlot'] = '4.7.1'
variables['infinispan2lcSlot'] = 'for-orm-' + rootProject.ormVersion.family
//Dependency on another Feature Pack:
dependency "org.wildfly:wildfly-feature-pack:${project.wildflyVersion}" // It will assume it is "zip" by default
//Ensure we declare all source repositories explicitly
autoAddRepositories = false
}
task createCoreFeaturePackZip( type: Zip, dependsOn: [featurepack] ) {
baseName 'hibernate-orm-jbossmodules'
from project.fpackStagingDir
}
provision {
dependsOn( createCoreFeaturePackZip )
dependsOn( ":hibernate-envers:jar")
dependsOn( ":hibernate-core:jar")
configuration = file( 'wildfly-server-provisioning.xml' )
destinationDir = file( "$project.wildFlyInstallDir" )
//Override HCANN:
override( 'org.hibernate.common:hibernate-commons-annotations' ) {
version = project.hibernateCommonsVersion
}
variables['wildfly.version'] = project.wildflyVersion
variables['hibernate-orm.version'] = rootProject.ormVersion.fullName
//Ensure we declare all source repositories explicitly
autoAddRepositories = false
}
dependencies {
testCompile project( ":hibernate-core" )
testCompile project( ":hibernate-envers" )
testCompile libraries.junit
testCompile 'org.antlr:antlr4-runtime:4.7.1'
testCompile libraries.antlr
testCompile libraries.arquillian_junit_container
testCompile libraries.arquillian_protocol_servlet
testCompile libraries.shrinkwrap_descriptors_api_javaee
testCompile libraries.shrinkwrap_descriptors_impl_javaee
testCompile libraries.wildfly_arquillian_container_managed
featurePack libraries.byteBuddy
featurePack libraries.antlr4_runtime
featurePack project( ":hibernate-core" )
featurePack project( ":hibernate-envers" )
featurePack "org.wildfly:jipijapa-hibernate5:${wildflyVersion}"
featurePack "org.antlr:antlr4-runtime:4.7.1"
}
publishing {
publications {
publishedArtifacts {
artifact( createCoreFeaturePackZip ) {
artifactId 'hibernate-orm-jbossmodules'
description 'Main feature pack of Hibernate ORM: hibernate-core and hibernate-envers, including essential dependencies such as Byte Buddy'
}
}
}
}
task ciBuild( dependsOn: [clean, test, publish] )
task release( dependsOn: [clean, test, bintrayUpload] )
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// tasks related to in-container (Arquillian + WF) testing
task prepareWildFlyForTests( dependsOn: [provision] ) {
description = 'Downloads the WildFly distribution, installs it into a local directory, includes present version of Hibernate ORM, JPA 2.2 : ready for integration tests'
}
test {
exclude 'org/hibernate/wildfly/model/**'
}
test.dependsOn prepareWildFlyForTests
//test.ignoreFailures = true
processTestResources {
expand(
[
wildFlyInstallDir : project.wildFlyInstallDir,
arquillianDeploymentExportDir: "${rootProject.buildDir.absolutePath}/arquillian-deployments"
]
)
}