forked from apache/geode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·408 lines (312 loc) · 13.7 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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"
apply plugin: 'antlr'
apply from: "${project.projectDir}/../gradle/publish-java.gradle"
apply from: "${project.projectDir}/../gradle/pmd.gradle"
apply from: "${project.projectDir}/../gradle/jmh.gradle"
sourceSets {
jca {
compileClasspath += configurations.compileClasspath
runtimeClasspath += configurations.runtimeClasspath
}
}
idea {
module {
testSourceDirs += project.tasks.generateIntegrationTestGrammarSource.outputs.files
testSourceDirs += project.tasks.generateDistributedTestGrammarSource.outputs.files
testSourceDirs += project.tasks.generatePerformanceTestGrammarSource.outputs.files
testSourceDirs += project.tasks.generateUpgradeTestGrammarSource.outputs.files
}
}
def generatedResources = "$buildDir/generated-resources/main"
sourceSets {
main {
output.dir(generatedResources, builtBy: 'createVersionPropertiesFile')
}
test {
output.dir(generatedResources, builtBy: 'createVersionPropertiesFile')
}
}
sourceSets {
// This works around resource-look up between integrationTest and test source-sets.
// See GEODE-5803 / GEODE-5882
test.resources.srcDirs.each { testResourceSrc ->
integrationTest.resources.srcDir {
testResourceSrc
}
}
}
// Creates the version properties file and writes it to the classes dir
task createVersionPropertiesFile(dependsOn: ':writeBuildInfo') {
def propertiesFile = file(generatedResources + "/org/apache/geode/internal/GemFireVersion.properties")
def scmInfoFile = rootProject.tasks.writeBuildInfo.outputs.files
inputs.files {
scmInfoFile
}
outputs.files {
propertiesFile
}
def props = [
"Product-Name" : productName,
"Product-Version" : version,
"Build-Id" : "${System.env.USER} ${buildId}".toString(),
"Build-Platform" : "${System.properties['os.name']} ${System.properties['os.version']} ${System.properties['os.arch']}".toString(),
"Build-Java-Vendor" : System.properties['java.vendor'],
"Build-Java-Version": System.properties['java.version']
] as Properties
inputs.properties(props)
doLast {
def scmInfo = new Properties()
new FileInputStream(scmInfoFile.singleFile).withStream { fis ->
scmInfo.load(fis)
}
props.putAll(scmInfo)
propertiesFile.getParentFile().mkdirs()
new FileOutputStream(propertiesFile).withStream { fos ->
props.store(fos, '')
}
}
}
ext.moduleName = group + '.core'
jar {
from sourceSets.main.output
from sourceSets.jca.output
exclude 'org/apache/geode/internal/i18n/StringIdResourceBundle_ja.txt'
exclude 'org/apache/geode/admin/doc-files/ds4_0.dtd'
inputs.property("moduleName", moduleName)
manifest {
attributes('Automatic-Module-Name': moduleName)
}
}
jar.dependsOn(createVersionPropertiesFile)
upgradeTest {
environment 'GEODE_HOME', "$buildDir/../../geode-assembly/build/install/apache-geode/"
}
repeatUpgradeTest {
environment 'GEODE_HOME', "$buildDir/../../geode-assembly/build/install/apache-geode/"
}
task raJar(type: Jar, dependsOn: classes) {
description 'Assembles the jar archive that contains the JCA classes'
from sourceSets.jca.output
exclude 'org/apache/geode/ra/**'
archiveName 'ra.jar'
}
task jcaJar(type: Jar, dependsOn: raJar) {
description 'Assembles the jar archive that contains the JCA bundle'
baseName 'geode-jca'
extension 'rar'
metaInf { from 'src/jca/ra.xml' }
from raJar.archivePath
}
configurations {
//declaring new configuration that will be used to associate with artifacts
archives
classesOutput {
extendsFrom api
description 'a dependency that exposes the compiled classes'
}
jmh {
extendsFrom testImplementation
}
raOutput
}
artifacts {
raOutput raJar
}
dependencies {
//These bom dependencies are used to constrain the versions of the dependencies listed below
api(platform(project(':boms:geode-all-bom')))
compileOnly(platform(project(':boms:geode-all-bom')))
testCompileOnly(platform(project(':boms:geode-all-bom')))
// As plugin configurations that do not extend from compile,
// we must explicitly impose version constraints on these configurations.
antlr platform(project(':boms:geode-all-bom'))
jcaAnnotationProcessor(platform(project(':boms:geode-all-bom')))
//A dependency that contains the compiled output of the source. What is this for?
classesOutput sourceSets.main.output
// Source Dependencies
//------------------------------------------------------------
// The antlr configuration is used by the antlr plugin, which compiles grammar
// files used by the query engine
antlr 'antlr:antlr'
// External
//------------------------------------------------------------
//Commons IO is used in persistence and management
api('commons-io:commons-io')
//tools.jar seems to be used by gfsh is some cases to control processes using
//the sun attach API? But this code path may not even be used?
compileOnly(files("${System.getProperty('java.home')}/../lib/tools.jar"))
//Find bugs is used in multiple places in the code to suppress findbugs warnings
compileOnly('com.github.stephenc.findbugs:findbugs-annotations')
testCompileOnly('com.github.stephenc.findbugs:findbugs-annotations')
//Spring web is used for SerializableObjectHttpMessageConverter
implementation('org.springframework:spring-web')
// find bugs leaks in from spring, needed to remove warnings.
compileOnly('com.google.code.findbugs:jsr305')
compileOnly('org.jetbrains:annotations')
//Jgroups is a core component of our membership system.
implementation('org.jgroups:jgroups')
//Antlr is used by the query engine.
implementation('antlr:antlr')
//Jackson annotations is used in gfsh
implementation('com.fasterxml.jackson.core:jackson-annotations')
//Jackson databind is used in gfsh, and also in pdx
implementation('com.fasterxml.jackson.core:jackson-databind')
//Commons validator is used to validate inet addresses in membership
implementation('commons-validator:commons-validator')
//jaxb is used by cluster configuration
implementation('javax.xml.bind:jaxb-api')
//jaxb is used by cluster configuration
implementation('com.sun.xml.bind:jaxb-impl')
//istack appears to be used only by jaxb, not in our code. jaxb doesn't
//declare this as required dependency though. It's unclear if this is needed
//Runtime
runtimeOnly('com.sun.istack:istack-commons-runtime') {
exclude group: '*'
}
runtimeOnly(project(':geode-deployment:geode-deployment-legacy'))
//Commons lang is used in many different places in core
implementation('org.apache.commons:commons-lang3')
//Commons modeler is used by the (deprecated) admin API
implementation('commons-modeler:commons-modeler') {
exclude module: 'commons-logging-api'
exclude module: 'mx4j-jmx'
exclude module: 'xml-apis'
ext.optional = true
}
//micrometer is used for micrometer based metrics from geode geode
api('io.micrometer:micrometer-core')
//FastUtil contains optimized collections that are used in multiple places in core
implementation('it.unimi.dsi:fastutil')
//Mail API is used by the deprecated admin API
implementation('javax.mail:javax.mail-api') {
ext.optional = true
}
//The resource-API is used by the JCA support.
api('javax.resource:javax.resource-api')
//MX4J is used by the old admin API
implementation('mx4j:mx4j') {
ext.optional = true
}
//MX4J remote is used by the old admin API
implementation('mx4j:mx4j-remote') {
ext.optional = true
}
//MX4J tools is used by the old admin API
implementation('mx4j:mx4j-tools') {
ext.optional = true
}
//JNA is used for locking memory and preallocating disk files.
implementation('net.java.dev.jna:jna')
implementation('net.java.dev.jna:jna-platform')
//JOptSimple is used by gfsh. A couple of usages have leaked into DiskStore
implementation('net.sf.jopt-simple:jopt-simple')
//Log4j is used everywhere
implementation('org.apache.logging.log4j:log4j-api')
implementation('io.swagger:swagger-annotations') {
ext.optional = true
}
runtimeOnly(project(':geode-http-service')) {
ext.optional = true
}
//Snappy is used for compressing values, if enabled
implementation('org.iq80.snappy:snappy') {
ext.optional = true
}
//Shiro is used for security checks throughout geode-core
//API - Shiro is exposed in geode's ResourcePermission class
api('org.apache.shiro:shiro-core')
//Classgraph is used by the gfsh cli, and also for function deployment (which happens in a server
//in response to a gfsh command)
implementation('io.github.classgraph:classgraph')
//RMIIO is used for uploading jar files and copying them between locator an servers
implementation('com.healthmarketscience.rmiio:rmiio')
//Geode-common has annotations and other pieces used geode-core
api(project(':geode-common'))
implementation(project(':geode-logging'))
implementation(project(':geode-membership'))
implementation(project(':geode-unsafe'))
implementation(project(':geode-serialization'))
implementation(project(':geode-tcp-server'))
//geode-management currently has pieces of the public API
//copied into it, so it is an API dependency
api(project(':geode-management'))
jcaCompile(sourceSets.main.output)
testImplementation(project(':geode-junit')) {
exclude module: 'geode-core'
}
testImplementation(project(':geode-concurrency-test'))
testImplementation('org.apache.bcel:bcel')
testImplementation('org.assertj:assertj-core')
testImplementation('org.mockito:mockito-core')
testImplementation('com.pholser:junit-quickcheck-core')
testImplementation('pl.pragmatists:JUnitParams')
testImplementation('com.tngtech.archunit:archunit-junit4')
testImplementation(project(path: ':geode-core', configuration: 'raOutput'))
testImplementation(files("${System.getProperty('java.home')}/../lib/tools.jar"))
testRuntime('commons-collections:commons-collections')
testRuntime('commons-configuration:commons-configuration')
testRuntime('commons-io:commons-io')
testRuntime('commons-validator:commons-validator')
testRuntime('com.pholser:junit-quickcheck-generators')
// Needed for JDK8, not JDK11, after nebula.facet v7.0.9
integrationTestImplementation(files("${System.getProperty('java.home')}/../lib/tools.jar"))
integrationTestImplementation(project(':geode-gfsh'))
integrationTestImplementation(project(':geode-junit'))
integrationTestImplementation(project(':geode-dunit'))
integrationTestImplementation(project(':geode-log4j'))
integrationTestImplementation(project(':geode-concurrency-test'))
integrationTestImplementation('org.apache.bcel:bcel')
integrationTestImplementation('org.apache.logging.log4j:log4j-core')
integrationTestImplementation('pl.pragmatists:JUnitParams')
integrationTestImplementation('com.tngtech.archunit:archunit-junit4')
integrationTestRuntime(project(path: ':geode-old-versions', configuration: 'testOutput'))
integrationTestRuntimeOnly('org.apache.derby:derby')
integrationTestRuntimeOnly('xerces:xercesImpl')
integrationTestRuntimeOnly('com.fasterxml.jackson.datatype:jackson-datatype-jsr310')
distributedTestImplementation(project(':geode-gfsh'))
distributedTestImplementation(project(':geode-junit')) {
exclude module: 'geode-core'
}
distributedTestImplementation(project(':geode-dunit')) {
exclude module: 'geode-core'
}
distributedTestImplementation(project(':geode-log4j')) {
exclude module: 'geode-core'
}
distributedTestImplementation('pl.pragmatists:JUnitParams')
distributedTestImplementation('com.jayway.jsonpath:json-path-assert')
distributedTestImplementation('net.openhft:compiler')
distributedTestRuntimeOnly(project(path: ':geode-old-versions', configuration: 'testOutput'))
distributedTestRuntimeOnly('org.apache.derby:derby')
upgradeTestImplementation(project(':geode-dunit')) {
exclude module: 'geode-core'
}
upgradeTestRuntimeOnly(project(path: ':geode-old-versions', configuration: 'testOutput'))
upgradeTestRuntimeOnly(project(':geode-log4j'))
performanceTestImplementation(project(':geode-junit')) {
exclude module: 'geode-core'
}
performanceTestImplementation(project(':geode-log4j'))
}
tasks.eclipse.dependsOn(generateGrammarSource)
distributedTest {
// Some tests have inner tests that should be ignored
exclude "**/*\$*.class"
}
rootProject.generate.dependsOn(generateGrammarSource)