forked from copper-engine/copper-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
489 lines (408 loc) · 17.4 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
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
import groovy.xml.QName
import java.nio.charset.StandardCharsets
buildscript {
repositories {
jcenter() // needed for gradle-nexus-plugin
mavenCentral() // needed for nexus-workflow plugin
maven { // needed for license-gradle-plugin
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
// The nexus plugin makes uploading to Sonatype Nexus repository easier.
// See https://github.com/bmuschko/gradle-nexus-plugin for documentation
classpath 'org.gradle.api.plugins:gradle-nexus-plugin:0.7'
// The nexus-workflow plugin automates the staging/promotion/release process on Sonatype OSS
// by providing the task 'nexusStagingRelease'.
// See https://github.com/adaptivecomputing/plugins-gradle/tree/master/nexus-workflow
// and http://stackoverflow.com/questions/20432907/automated-release-to-maven-central-with-gradle
classpath 'com.adaptc.gradle:nexus-workflow:0.6'
// the license plugin, see https://github.com/hierynomus/license-gradle-plugin
classpath 'gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.13.0'
// the spotbugs plugin, see https://plugins.gradle.org/plugin/com.github.spotbugs
// DISABLED: spotbugs is currently not compatible with Gradle 5
// classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.8"
// Plugin to create modular jars that target a Java release before 9 (https://github.com/beryx/badass-jar-plugin)
classpath "gradle.plugin.org.beryx:badass-jar:1.2.0"
// Plugin for loading project properties from gradle-local.properties
classpath "net.saliman:gradle-properties-plugin:1.5.1"
// OSGI plugin
classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:5.2.0"
}
}
allprojects {
apply plugin: 'project-report'
apply plugin: "net.saliman.properties"
// DISABLED: spotbugs is currently not compatible with Gradle 5
// apply plugin: "com.github.spotbugs"
group = "org.copper-engine"
repositories {
mavenCentral()
}
}
def getProperSubprojects() {
subprojects.findAll {
new File(it.projectDir, 'src/main/java').directory
}
}
configure(properSubprojects) {
println "configuring java module " + project.path
apply plugin: 'java-library'
apply plugin: 'biz.aQute.bnd.builder'
apply plugin: "org.beryx.jar"
compileJava.options.encoding = StandardCharsets.UTF_8
compileTestJava.options.encoding = StandardCharsets.UTF_8
apply plugin: 'maven'
sourceCompatibility = 1.8
targetCompatibility = 1.8
task createSourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task createJavadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives createSourcesJar
archives createJavadocJar
}
// spotbugs {
// toolVersion = '3.1.3'
// sourceSets = (javaVersion >= 10) ? [] : [project.sourceSets.main]// check only main classes, neither tests nor example workflow classes
// excludeFilter = file("$rootDir/common/findbugs-exclude-filter.xml")
// effort = "max"
// ignoreFailures = true
// }
//
// spotbugsMain {
// reports {
// // Unfortunately FindBugs cannot emit both XML and HTML report simultanously, so by default we emit HTML only.
// // We emit XML only when -PfindbugsXmlReportEnabled=true, e.g. during Jenkins build
// def findbugsXmlReportEnabled = project.hasProperty('findbugsXmlReportEnabled') && project.property('findbugsXmlReportEnabled')
// xml.enabled = findbugsXmlReportEnabled
// html.enabled = !findbugsXmlReportEnabled
// }
// }
//
// spotbugsTest.enabled = false
if (!project.getName().contains('orch-interfaces')) {
apply plugin: 'com.github.hierynomus.license'
license {
// verify that every java file has our Apache License header; fail build if header is missing
header file("$rootDir/common/apache-license-file.txt")
skipExistingHeaders true
ignoreFailures true
}
}
apply plugin: 'eclipse'
eclipse {
classpath {
defaultOutputDir = file('build')
file {
//exclude slf4f log binding from export
withXml {
Node root = it.asNode()
NodeList nodeList = root.getAt(new QName('classpathentry'))
nodeList.each { Node classpathentry ->
if (classpathentry.attributes().path.contains('slf4j-log4j12')) {
classpathentry.attributes().remove('exported')
}
}
}
}
}
jdt {
file {
// add our code style settings to every eclipse project
withProperties { properties ->
def codestyle = new XmlParser().parse(file("$rootDir/common/eclipse-codestyle.xml"))
codestyle.profile[0].setting.each {
properties.put(it.'@id', it.'@value')
}
}
whenMerged {
def uiprops = new Properties();
uiprops.put('eclipse.preferences.version', '1')
uiprops.put('formatter_profile', '_SCOOP-CodeStyle')
uiprops.put('formatter_settings_version', '12')
uiprops.store(file("$projectDir/.settings/org.eclipse.jdt.ui.prefs").newWriter(), "generated by build.gradle")
}
}
}
}
// be sure to always regenerate eclipse files, because default behavior is merging into existing files
tasks.eclipse.dependsOn cleanEclipse
eclipse.classpath.defaultOutputDir = new File("$buildDir/classes/main")
dependencies {
implementation('com.github.javaparser:javaparser-symbol-solver-core:3.6.23') {
exclude module: 'javaparser-symbol-solver-model'
}
implementation "org.slf4j:slf4j-api:$slf4jVersion"
testImplementation('junit:junit:4.11') {
exclude module: 'hamcrest-core'
}
testImplementation 'org.mockito:mockito-core:2.23.4'
testImplementation 'net.bytebuddy:byte-buddy:1.10.17'
testImplementation 'org.hamcrest:hamcrest-core:1.3'
// spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.7.1'
}
jar {
manifest.attributes provider: 'gradle'
multiRelease = false
}
javadoc {
onlyIf { !project.sourceCompatibility.java9Compatible }
options.encoding = StandardCharsets.UTF_8
options.addBooleanOption('html5', true)
exclude '**/module-info.java'
}
if (!project.sourceCompatibility.java9Compatible && project.hasProperty('nexusUsername')) {
// the nexus plugin makes uploading to Sonatype Nexus repository easier
// see https://github.com/bmuschko/gradle-nexus-plugin for documentation
apply plugin: 'nexus'
nexus {
attachTests = true
sign = true
}
modifyPom {
project {
name = 'COPPER high-performance workflow engine'
packaging = 'jar'
description = 'COPPER is an open-source, powerful, light-weight, and easily configurable workflow engine. The power of COPPER is that it uses Java as a description language for workflows.'
url 'http://copper-engine.org/'
scm {
url 'https://github.com/copper-engine/copper-engine'
connection 'scm:[email protected]:copper-engine/copper-engine.git'
}
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'copper-team'
name = 'Copper Engine Development Team'
roles {
role 'architect'
role 'developer'
role 'tester'
}
}
}
}
}
}
test {
testLogging {
exceptionFormat = 'full'
}
}
}
configure(rootProject) {
// The nexus-workflow plugin automates the staging/promotion/release process on Sonatype OSS
// by providing the task 'nexusStagingRelease'. We perform "nexusStagingRelease" only if the current
// version is not a SNAPSHOT release.
apply plugin: 'nexus-workflow'
tasks.nexusStagingRelease.onlyIf { !version.endsWith("-SNAPSHOT") }
// task to create source distribution containing all source files
// note: this task won't run automatically; it must be called explicitely
task fullSourcesJar(type: Jar) {
classifier = 'sources-full'
from project.rootDir
exclude '**/build/'
exclude '**/classes/'
exclude '**/generated/'
exclude '.gradle/'
exclude 'tmp/'
exclude '.idea'
exclude '**/*.iml'
exclude '**/*.log'
exclude '**/*.classpath'
exclude '**/*.project'
exclude '**/*.settings/'
}
// copy Intellij Codestyle settings each time 'gradle assemble' or 'gradle build' is performed on the root project
task ideaCodeStyleSetup(type: Copy) {
from 'common/intellij-codestyle.xml'
into '.idea/'
rename '.+', 'codeStyleSettings.xml'
}
ideaCodeStyleSetup.onlyIf { file(".idea").exists() }
assemble.dependsOn ideaCodeStyleSetup
}
project(':projects:copper-jmx-interface') {
ext.moduleName = 'org.copperengine.management'
dependencies {
}
}
project(':projects:copper-regtest') {
ext.moduleName = 'org.copperengine.regtest'
sourceSets {
workflow {
ext.srcDir = "$projectDir/src/workflow/java"
}
}
sourceSets.test.resources.srcDirs += sourceSets.workflow.srcDir
tasks.testClasses.doLast {
if(project.sourceCompatibility.java9Compatible) {
copy {
from sourceSets.test.resources.srcDirs
into "$buildDir/classes/java/test"
}
}
}
dependencies {
implementation project(':projects:copper-coreengine')
implementation project(':projects:copper-spring')
implementation project(':projects:copper-ext')
implementation "org.ow2.asm:asm:$asmVersion"
implementation "org.ow2.asm:asm-tree:$asmVersion"
implementation "org.yaml:snakeyaml:$snakeyamlVersion"
implementation "org.springframework:spring-jdbc:$springVersion"
implementation "org.springframework:spring-context:$springVersion"
implementation "org.springframework:spring-tx:$springVersion"
implementation "com.google.guava:guava:$guavaVersion"
testRuntimeOnly fileTree(dir: "$rootDir/3rdPartyLibs", include: '*.jar')
testImplementation 'mysql:mysql-connector-java:5.1.25'
testImplementation 'org.apache.derby:derby:10.13.1.1'
testImplementation 'postgresql:postgresql:9.1-901.jdbc4'
testImplementation 'com.h2database:h2:1.4.193'
testImplementation "com.mchange:c3p0:$c3p0Version"
testImplementation "org.slf4j:slf4j-api:$slf4jVersion"
}
}
project(':projects:copper-ext') {
ext.moduleName = 'org.copperengine.ext'
dependencies {
implementation project(':projects:copper-coreengine')
implementation "org.eclipse.jgit:org.eclipse.jgit:$jgitVersion"
implementation "org.ow2.asm:asm:$asmVersion"
implementation "org.ow2.asm:asm-tree:$asmVersion"
implementation "commons-io:commons-io:$commonsIoVersion"
implementation "com.google.guava:guava:$guavaVersion"
implementation "org.yaml:snakeyaml:$snakeyamlVersion"
testImplementation "org.slf4j:slf4j-api:$slf4jVersion"
//testImplementation 'org.apache.logging.log4j:log4j-core:2.+'
//testImplementation 'org.slf4j:slf4j-log4j12:2.+'
}
}
project(':projects:copper-cassandra:cassandra-storage') {
ext.moduleName = 'org.copperengine.cassandra.storage'
dependencies {
implementation project(':projects:copper-coreengine')
implementation project(':projects:copper-ext')
api "com.datastax.cassandra:cassandra-driver-core:$cassandraDriverVersion"
api "com.google.guava:guava:$guavaVersion"
implementation "org.slf4j:slf4j-api:$slf4jVersion"
implementation "org.ow2.asm:asm:$asmVersion"
implementation "org.ow2.asm:asm-tree:$asmVersion"
implementation "commons-io:commons-io:$commonsIoVersion"
implementation 'commons-lang:commons-lang:2.6'
implementation "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
implementation "org.yaml:snakeyaml:$snakeyamlVersion"
testImplementation('org.cassandraunit:cassandra-unit:3.1.1.0') {
exclude module: 'hamcrest-core'
exclude module: 'hamcrest-library'
exclude module: 'cassandra-thrift'
exclude module: 'high-scale-lib'
}
}
}
project(':projects:copper-cassandra:cassandra-loadtest') {
apply plugin:'application'
ext.moduleName = 'org.copperengine.cassandra.loadtest'
mainClassName = "org.copperengine.core.persistent.cassandra.loadtest.PermanentLoadCreator"
dependencies {
implementation project(':projects:copper-coreengine')
implementation project(':projects:copper-ext')
implementation project(':projects:copper-cassandra:cassandra-storage')
implementation "org.slf4j:slf4j-api:$slf4jVersion"
implementation "org.ow2.asm:asm:$asmVersion"
implementation "org.ow2.asm:asm-tree:$asmVersion"
implementation "org.yaml:snakeyaml:$snakeyamlVersion"
}
}
project(':projects:copper-spring') {
ext.moduleName = 'org.copperengine.spring'
dependencies {
implementation project(':projects:copper-coreengine')
implementation "org.ow2.asm:asm:$asmVersion"
implementation "org.ow2.asm:asm-tree:$asmVersion"
// Spring
implementation "org.springframework:spring-aop:$springVersion"
implementation "org.springframework:spring-beans:$springVersion"
implementation "org.springframework:spring-context:$springVersion"
implementation "org.springframework:spring-core:$springVersion"
implementation "org.springframework:spring-expression:$springVersion"
implementation "org.springframework:spring-jdbc:$springVersion"
implementation "org.springframework:spring-tx:$springVersion"
implementation 'org.springframework.batch:spring-batch-infrastructure:4.0.1.RELEASE'
}
}
project(':projects:copper-coreengine') {
ext.moduleName = 'org.copperengine.core'
dependencies {
api project(':projects:copper-jmx-interface')
compile "org.slf4j:slf4j-api:$slf4jVersion"
// asm
implementation "org.ow2.asm:asm:$asmVersion"
implementation "org.ow2.asm:asm-commons:$asmVersion"
implementation "org.ow2.asm:asm-tree:$asmVersion"
implementation "org.ow2.asm:asm-util:$asmVersion"
implementation "org.ow2.asm:asm-analysis:$asmVersion"
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'com.sun.activation:javax.activation:1.2.0'
}
task scriptsZip(type: Zip) {
classifier = 'scripts'
from file("src/main/database")
into 'scripts/sql'
}
assemble.dependsOn scriptsZip
artifacts {
archives scriptsZip
}
}
subprojects {
task allDeps(type: DependencyReportTask) {}
}
project(':projects:copper-performance-test') {
ext.moduleName = 'org.copperengine.performancetest'
dependencies {
implementation project(':projects:copper-coreengine')
implementation project(':projects:copper-ext')
implementation project(':projects:copper-cassandra:cassandra-storage')
implementation "org.ow2.asm:asm:$asmVersion"
implementation "org.ow2.asm:asm-tree:$asmVersion"
implementation "org.yaml:snakeyaml:$snakeyamlVersion"
implementation "com.google.guava:guava:$guavaVersion"
implementation 'mysql:mysql-connector-java:5.1.39'
implementation 'org.apache.derby:derby:10.13.1.1'
implementation 'postgresql:postgresql:9.1-901.jdbc4'
implementation 'com.h2database:h2:1.4.193'
implementation "com.mchange:c3p0:$c3p0Version"
implementation "org.slf4j:slf4j-api:$slf4jVersion"
runtimeOnly fileTree(dir: "$rootDir/3rdPartyLibs", include: '*.jar')
}
jar {
dependsOn ':projects:copper-coreengine:jar', ':projects:copper-ext:jar', ':projects:copper-cassandra:cassandra-storage:jar'
manifest.attributes provider: 'gradle'
archiveName = "copper-performance-test.jar"
from {
configurations.runtime.collect {
it.isDirectory() ? it : zipTree(it)
}
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
}
manifest {
attributes 'Main-Class': 'org.copperengine.performancetest.main.Main'
}
}
}