This repository has been archived by the owner on Aug 27, 2021. It is now read-only.
forked from hibernate/hibernate-hql-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
324 lines (276 loc) · 12 KB
/
build.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
apply plugin: 'eclipse'
apply plugin: 'idea'
apply from: "./libraries.gradle"
ext {
projectVersion = '1.5.1-SNAPSHOT'
javaLanguageLevel = '1.8'
jbossPublicUrl = 'http://repository.jboss.org/nexus/content/groups/public/'
jbossSnaphotsUrl = 'https://repository.jboss.org/nexus/content/repositories/snapshots/'
jbossReleasesDeployUrl = 'https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/'
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
name 'jboss-public'
url rootProject.jbossPublicUrl
}
maven {
name 'jboss-snapshots'
url rootProject.jbossSnaphotsUrl
}
}
}
buildscript {
repositories {
mavenCentral()
mavenLocal()
maven {
name 'jboss-public'
url 'http://repository.jboss.org/nexus/content/groups/public/'
}
maven {
name 'jboss-snapshots'
url 'https://repository.jboss.org/nexus/content/repositories/snapshots/'
}
}
dependencies {
classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.1'
}
subprojects { subProject ->
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'checkstyle'
apply plugin: 'maven-publish'
apply plugin: 'maven-publish-auth'
// Installing snapshot JARs to the local repo doesn't work correctly via the new Maven publishing plug-in
// (GRADLE-2762). Therefore the old plug-in is used for that purpose (via ./gradlew install). Deployments to the
// remote repo should be done using the new plug-in (via ./gradlew publish).
apply plugin: 'maven'
group = 'org.hibernate.hql'
//artifactId = project name as created in settings.gradle
version = rootProject.projectVersion
//following convention from ORM
buildDir = "target"
ext {
generatedLoggingSourcesDir = "${buildDir}/generated-src/logging/main"
generatedAntlrSourcesDir = "$buildDir/generated-src/antlr/main"
}
sourceCompatibility = rootProject.javaLanguageLevel
targetCompatibility = rootProject.javaLanguageLevel
configurations {
jbossLoggingGenerator
animalSniffer
javaApiSignature
all {
resolutionStrategy {
failOnVersionConflict()
force libraries.antlr3_runtime
force libraries.jboss_logging
force libraries.slf4j_api
}
}
}
dependencies {
testCompile( libraries.junit )
testCompile( libraries.fest_assert )
jbossLoggingGenerator( libraries.jboss_logging_processor )
animalSniffer ( libraries.animal_sniffer )
javaApiSignature ( libraries.java18_signature )
}
sourceSets.main {
ext.originalJavaSrcDirs = java.srcDirs
java.srcDir "${generatedAntlrSourcesDir}"
ext.javaAndAntlrSrcDirs = java.srcDirs
java.srcDir "${generatedLoggingSourcesDir}"
}
compileJava.options.define(compilerArgs: ["-proc:none", "-encoding", "UTF-8"])
compileTestJava.options.define(compilerArgs: ["-proc:none", "-encoding", "UTF-8"])
jar.manifest.attributes(
"Implementation-Title": "${subProject.name}",
"Implementation-Version": "${subProject.version}",
"Implementation-Vendor": "hibernate.org",
"Implementation-Vendor-Id": "hibernate.org",
"Implementation-URL": "http://www.hibernate.org"
)
task generateMainLoggingClasses(type: JavaCompile) {
//class output dir, required by JavaCompile
ext.aptDumpDir = file( "${buildDir}/tmp/apt/logging" )
destinationDir = aptDumpDir
classpath = compileJava.classpath + configurations.jbossLoggingGenerator
source = sourceSets.main.javaAndAntlrSrcDirs
ext.sourceDestDir = file ( "$generatedLoggingSourcesDir" )
options.define(
compilerArgs: [
"-nowarn",
"-proc:only",
"-encoding", "UTF-8",
"-processor", "org.jboss.logging.processor.apt.LoggingToolsProcessor",
"-s", sourceDestDir.absolutePath,
"-Adebug=true",
"-AskipTranslations=true",
"-source", rootProject.javaLanguageLevel,
"-target", rootProject.javaLanguageLevel,
]
);
inputs.dir source
outputs.dir generatedLoggingSourcesDir;
doFirst {
sourceDestDir.mkdirs()
}
doLast {
aptDumpDir.delete()
}
}
checkstyle {
sourceSets = [ subProject.sourceSets.main ]
configFile = rootProject.file( 'shared/config/checkstyle/checkstyle.xml' )
showViolations = true
ignoreFailures = false
}
checkstyleMain.source = sourceSets.main.originalJavaSrcDirs
task copyJavaApiSignature(type: Copy) {
from configurations.javaApiSignature
into "$buildDir/javaApiSignature/"
rename '.*signature', 'javaApi.signature'
}
// checks that only types of the target Java version are used
task checkJavaApiSignature << {
ant.taskdef(name: 'animalSniffer', classname: 'org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask', classpath: configurations.animalSniffer.asPath)
ant.animalSniffer(signature: "$buildDir/javaApiSignature/javaApi.signature", classpath: configurations.compile.asPath) {
path(path: "$buildDir/classes/main")
}
}
checkJavaApiSignature.dependsOn compileJava
checkJavaApiSignature.dependsOn copyJavaApiSignature
check.dependsOn checkJavaApiSignature
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
// Can be removed once the old Maven plug-in isn't required anymore
artifacts {
archives sourceJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier "sources"
}
repositories {
//authentication is done via maven-publish-auth plug-in, which takes values from ~/.m2/settings.xml
maven {
if ( subProject.version.endsWith( 'SNAPSHOT' ) ) {
name 'jboss-snapshots-repository'
url rootProject.jbossSnaphotsUrl
}
else {
name 'jboss-releases-repository'
url rootProject.jbossReleasesDeployUrl
}
}
}
pom.withXml {
// append additional metadata
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name subProject.pomName()
description subProject.pomDescription()
url 'http://ogm.hibernate.org/'
inceptionYear '2012'
organization {
name 'Hibernate.org'
url 'http://www.hibernate.org/'
}
issueManagement {
system 'jira'
url 'https://hibernate.atlassian.net/browse/HQLPARSER'
}
scm {
url 'http://github.com/hibernate/hibernate-hql-parser'
connection 'scm:git:http://github.com/hibernate/hibernate-hql-parser.git'
developerConnection 'scm:git:git@github.com:hibernate/hibernate-hql-parser.git'
}
licenses {
license {
name 'GNU Lesser General Public License'
url 'http://www.gnu.org/licenses/lgpl-2.1.html'
comments 'See also http://hibernate.org/license'
distribution 'repo'
}
}
ciManagement {
system 'jenkins'
url 'http://ci.hibernate.org/'
}
developers {
developer {
id 'sannegrinovero'
name 'Sanne Grinovero'
organization 'Red Hat, Inc.'
email 'sanne@hibernate.org'
url 'http://in.relation.to/Bloggers/Sanne'
}
developer {
id 'sebersole'
name 'Steve Ebersole'
organization 'Red Hat, Inc.'
email 'steve@hibernate.org'
url 'http://in.relation.to/Bloggers/Steve'
}
developer {
id 'gunnarmorling'
name 'Gunnar Morling'
organization 'Red Hat, Inc.'
email 'gunnar@hibernate.org'
url 'http://in.relation.to/Bloggers/Gunnar'
}
}
mailingLists {
mailingList {
name 'Hibernate Announcements'
post 'hibernate-announce@lists.jboss.org'
subscribe 'https://lists.jboss.org/mailman/listinfo/hibernate-announce'
unsubscribe 'https://lists.jboss.org/mailman/listinfo/hibernate-announce'
archive 'http://lists.jboss.org/pipermail/hibernate-dev/'
}
mailingList {
name 'Hibernate Commit Notifications'
post 'hibernate-commits@lists.jboss.org'
subscribe 'https://lists.jboss.org/mailman/listinfo/hibernate-commits'
unsubscribe 'https://lists.jboss.org/mailman/listinfo/hibernate-commits'
archive 'http://lists.jboss.org/pipermail/hibernate-commits/'
}
mailingList {
name 'Hibernate Developers'
post 'hibernate-dev@lists.jboss.org'
subscribe 'https://lists.jboss.org/mailman/listinfo/hibernate-dev'
unsubscribe 'https://lists.jboss.org/mailman/listinfo/hibernate-dev'
archive 'http://lists.jboss.org/pipermail/hibernate-dev/'
}
mailingList {
name 'Hibernate Issue Notifications'
post 'hibernate-issues@lists.jboss.org'
subscribe 'https://lists.jboss.org/mailman/listinfo/hibernate-issues'
unsubscribe 'https://lists.jboss.org/mailman/listinfo/hibernate-issues'
archive 'http://lists.jboss.org/pipermail/hibernate-issues/'
}
}
}
// TEMPORARY : currently Gradle Publishing feature is exporting dependencies as 'runtime' scope,
// rather than 'compile'; fix that.
asNode().dependencies[0].dependency.each {
it.scope[0].value = 'compile'
}
}
}
}
}
}