-
Notifications
You must be signed in to change notification settings - Fork 78
/
build.gradle
698 lines (601 loc) · 21.5 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
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
/*
* Copyright 2018 ConsenSys AG.
*
* Licensed 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.
*/
import com.github.jk1.license.filter.LicenseBundleNormalizer
import groovy.transform.Memoized
import net.ltgt.gradle.errorprone.CheckSeverity
import tech.pegasys.internal.license.reporter.GroupedLicenseHtmlRenderer
import java.text.SimpleDateFormat
buildscript {
repositories {
maven { url "https://artifacts.consensys.net/public/maven/maven/" }
}
dependencies {
classpath 'tech.pegasys.internal.license.reporter:license-reporter:1.1.1'
}
}
plugins {
id 'org.owasp.dependencycheck' version "11.1.0"
id 'java-test-fixtures'
id 'com.diffplug.spotless' version '7.0.0.BETA4'
id 'com.github.ben-manes.versions' version '0.51.0' //`./gradlew dependencyUpdates` to report outdated dependencies
id 'com.github.jk1.dependency-license-report' version '2.8'
id 'io.spring.dependency-management' version '1.1.6'
id 'me.champeau.jmh' version '0.7.2' apply false
id 'net.ltgt.errorprone' version '4.1.0'
id 'org.ajoberstar.grgit' version '5.3.0'
}
if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_21)) {
throw new GradleException("Java 21 or later is required to build Web3Signer.\n" +
" Detected version ${JavaVersion.current()}")
}
rootProject.version = calculatePublishVersion()
def specificVersion = calculateVersion()
group = 'tech.pegasys.web3signer'
defaultTasks 'build', 'checkLicense', 'javadoc'
def buildAliases = ['dev': [
'spotlessApply',
'build',
'checkLicense',
'javadoc'
]]
def expandedTaskList = []
gradle.startParameter.taskNames.each {
expandedTaskList << (buildAliases[it] ? buildAliases[it] : it)
}
gradle.startParameter.taskNames = expandedTaskList.flatten()
// Gets a integer command argument, passed with -Pname=x, or the default if not provided.
def _intCmdArg(name, defaultValue) {
return project.hasProperty(name) ? project.property(name) as int : defaultValue
}
def _intCmdArg(name) {
return _intCmdArg(name, null)
}
def _strListCmdArg(name, defaultValue) {
if (!project.hasProperty(name))
return defaultValue
return ((String)project.property(name)).tokenize(',')
}
def _strListCmdArg(name) {
return _strListCmdArg(name, null)
}
allprojects {
apply plugin: 'java-library'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
apply plugin: 'net.ltgt.errorprone'
apply plugin: 'org.owasp.dependencycheck'
apply from: "${rootDir}/gradle/versions.gradle"
version = rootProject.version
jacoco { toolVersion = '0.8.11' }
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
sourceCompatibility = 21
targetCompatibility = 21
repositories {
// mavenLocal() //for local testing only, uncomment while testing locally build signers.
mavenCentral()
maven { url "https://artifacts.consensys.net/public/maven/maven/" }
maven { url "https://artifacts.consensys.net/public/teku/maven/" }
maven { url "https://hyperledger.jfrog.io/artifactory/besu-maven" }
maven { url "https://hyperledger-org.bintray.com/besu-repo/" }
maven { url "https://jitpack.io" }
}
dependencies {
errorprone("com.google.errorprone:error_prone_core")
errorprone("tech.pegasys.tools.epchecks:errorprone-checks")
}
apply plugin: 'com.diffplug.spotless'
spotless {
java {
// This path needs to be relative to each project
target fileTree('.') {
include '**/*.java'
exclude '**/.gradle/**'
exclude '**/build/**'
exclude '.openapidoc/**'
}
// See gradle.properties for exports/opens flags required by JDK 16 and Google Java Format plugin
googleJavaFormat('1.22.0')
importOrder 'tech.pegasys', 'java', ''
trimTrailingWhitespace()
endWithNewline()
licenseHeaderFile "${rootDir}/gradle/spotless.java.license"
}
}
dependencyCheck {
nvd {
apiKey = System.getenv('NVD_API_KEY')
}
failBuildOnCVSS = 7 // Fail on high CVSS severity
suppressionFile = "${rootDir}/gradle/owasp-suppression.xml"
skipConfigurations = [
'integrationTestCompileClasspath',
'integrationTestRuntimeClasspath'
]
skipProjects = [
':acceptance-tests'
]
analyzers {
retirejs {
enabled = false
}
assemblyEnabled = false
}
}
tasks.withType(JavaCompile) {
options.compilerArgs += [
'-Xlint:unchecked',
'-Xlint:cast',
'-Xlint:rawtypes',
'-Xlint:overloads',
'-Xlint:divzero',
'-Xlint:finally',
'-Xlint:static',
'-Werror',
]
options.errorprone {
excludedPaths = '.*/(generated/*.*|.*ReferenceTest_.*)'
// Our equals need to be symmetric, this checker doesn't respect that.
check('EqualsGetClass', CheckSeverity.OFF)
// We like to use futures with no return values.
check('FutureReturnValueIgnored', CheckSeverity.OFF)
// We use the JSR-305 annotations instead of the Google annotations.
check('ImmutableEnumChecker', CheckSeverity.OFF)
// This is a style check instead of an error-prone pattern.
check('UnnecessaryParentheses', CheckSeverity.OFF)
// Lazy impl causes excess CPU usage O(n) of non-final field when it should be O(1).
check('FieldCanBeFinal', CheckSeverity.OFF)
// Incorrectly fires when there are no java.time.* alternatives
check('PreferJavaTimeOverload', CheckSeverity.OFF)
check('InsecureCryptoUsage', CheckSeverity.WARN)
check('WildcardImport', CheckSeverity.WARN)
// TODO: Review/fix/enable checks from errorprone-checks.
check('DoNotCreateSecureRandomDirectly', CheckSeverity.OFF)
check('DoNotInvokeMessageDigestDirectly', CheckSeverity.OFF)
check('DoNotReturnNullOptionals', CheckSeverity.OFF)
check('JavaCase', CheckSeverity.OFF)
check('MethodInputParametersMustBeFinal', CheckSeverity.OFF)
}
options.encoding = 'UTF-8'
}
/*
* Pass some system properties provided on the gradle command line to test executions for
* convenience.
*
* The properties passed are:
* The meaning being that will be run only the tests for which the value passed as "include"
* (which can be a java pattern) matches parts of the test name. Knowing that tests names for
* reference tests are of the form:
* <name>(-<milestone>([<variant>])?)?
* where <name> is the test name as defined in the json file (usually the name of the json file
* as well), <milestone> is the Ethereum milestone tested (not all test use it) and <variant>
* is only use in some general state tests where for the same json file and same milestone,
* multiple variant of that test are run. The variant is a simple number.
* - 'root.log.level' and 'evm.log.level': allow to control the log level used during the tests.
*/
test {
jvmArgs = [
'-Xmx4g',
'-XX:-UseGCOverheadLimit',
// Mockito and jackson-databind do some strange reflection during tests.
// This suppresses an illegal access warning.
'--add-opens',
'java.base/java.util=ALL-UNNAMED',
'--add-opens',
'java.base/java.util.concurrent=ALL-UNNAMED'
]
Set toImport = [
'root.log.level',
'evm.log.level'
]
for (String name : toImport) {
if (System.getProperty(name) != null) {
systemProperty name, System.getProperty(name)
}
}
useJUnitPlatform()
}
javadoc {
options.addStringOption('Xdoclint:all', '-quiet')
options.addStringOption('Xwerror', '-html5')
options.encoding = 'UTF-8'
}
}
task deploy() {}
licenseReport {
outputDir = "${buildDir}/reports/licenses"
excludes = [
'com.fasterxml.jackson:jackson-bom'
]
allowedLicensesFile = new File("${rootDir}/gradle/license-report-config/allowed-licenses.json")
filters = [
new LicenseBundleNormalizer(["bundlePath": new File("${rootDir}/gradle/license-report-config/license-normalizer.json"), "createDefaultTransformationRules": true])
]
renderers = [
new GroupedLicenseHtmlRenderer()
]
}
subprojects {
tasks.withType(Test) {
// If GRADLE_MAX_TEST_FORKS is not set, use half the available processors
maxParallelForks = (System.getenv('GRADLE_MAX_TEST_FORKS') ?: (Runtime.runtime.availableProcessors().intdiv(2) ?: 1)).toInteger()
}
tasks.withType(JavaCompile) {
options.fork = true
options.incremental = true
options.compilerArgs = ['-Xlint:deprecation']
}
sourceSets {
// test-support can be consumed as a library by other projects in their tests
testSupport {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/test-support/java')
}
resources.srcDir file('src/test-support/resources')
}
integrationTest {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/integration-test/java')
}
resources.srcDir file('src/integration-test/resources')
}
}
configurations {
testSupportImplementation.extendsFrom implementation
integrationTestImplementation.extendsFrom implementation
testSupportArtifacts
}
task testSupportJar (type: Jar) {
archiveBaseName = "${project.name}-support-test"
from sourceSets.testSupport.output
}
dependencies {
testImplementation sourceSets.testSupport.output
integrationTestImplementation sourceSets.testSupport.output
}
task integrationTest(type: Test, dependsOn:["compileTestJava"]){
group = "verification"
description = "Runs the Web3Signer integration tests"
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
jvmArgs = ['-Xms512m', '-Xmx1g']
useJUnitPlatform()
}
if (file('src/jmh').directory) {
apply plugin: 'me.champeau.gradle.jmh'
jmh {
// Allows to control JMH execution directly from the command line. I typical execution may look
// like:
// gradle jmh -Pf=2 -Pwi=3 -Pi=5 -Pinclude=MyBench
// which will run 2 forks with 3 warmup iterations and 5 normal ones for each, and will only
// run the benchmark matching 'MyBench' (a regexp).
warmupForks = _intCmdArg('wf')
warmupIterations = _intCmdArg('wi')
fork = _intCmdArg('f')
iterations = _intCmdArg('i')
benchmarkMode = _strListCmdArg('bm')
include = _strListCmdArg('include', [''])
humanOutputFile = project.file("${project.buildDir}/reports/jmh/results.txt")
resultFormat = 'JSON'
}
dependencies { jmh 'org.apache.logging.log4j:log4j-api' }
}
}
jar { enabled = false }
apply plugin: 'application'
mainClassName = "tech.pegasys.web3signer.Web3SignerApp"
applicationDefaultJvmArgs = [
"-Dvertx.disableFileCPResolving=true",
// We shutdown log4j ourselves, as otherwise his shutdown hook runs before our own and whatever
// happens during shutdown is not logged.
"-Dlog4j.shutdownHookEnabled=false",
"-Dlog4j2.formatMsgNoLookups=true",
// address netty warnings
"--add-opens",
"java.base/jdk.internal.misc=ALL-UNNAMED",
"--add-opens",
"java.base/java.nio=ALL-UNNAMED",
"-Dio.netty.tryReflectionSetAccessible=true",
"--add-exports",
"jdk.crypto.cryptoki/sun.security.pkcs11.wrapper=ALL-UNNAMED",
]
run {
args project.hasProperty("web3signer.run.args") ? project.property("web3signer.run.args").toString().split("\\s+") : []
doFirst {
applicationDefaultJvmArgs = applicationDefaultJvmArgs.collect{it.replace('WEB3SIGNER_HOME', "$buildDir/web3signer")}
}
}
startScripts {
def shortenWindowsClasspath = { line ->
line = line.replaceAll(/^set CLASSPATH=.*$/, "set CLASSPATH=%APP_HOME%/lib/*")
}
doLast {
unixScript.text = unixScript.text.replace('WEB3SIGNER_HOME', '\$APP_HOME')
windowsScript.text = windowsScript.text.replace('WEB3SIGNER_HOME', '%~dp0..')
// Prevent the error originating from the 8191 chars limit on Windows
windowsScript.text =
windowsScript
.readLines()
.collect(shortenWindowsClasspath)
.join('\r\n')
}
}
dependencies {
implementation project(':app')
errorprone 'com.google.errorprone:error_prone_core'
}
distributions {
main {
contents {
from("./LICENSE") { into "." }
from("build/reports/licenses") {
into "./licenses"
exclude "**/dependencies-without-allowed-license.json"
exclude "**/project-licenses-for-check-license-task.json"
}
from("./slashing-protection/src/main/resources/migrations") { into "./migrations" }
}
}
}
installDist { dependsOn checkLicense }
distTar {
dependsOn checkLicense
doFirst {
delete fileTree(dir: 'build/distributions', include: '*.tar.gz')
}
compression = Compression.GZIP
archiveExtension = 'tar.gz'
}
distZip {
dependsOn checkLicense
doFirst {
delete fileTree(dir: 'build/distributions', include: '*.zip')
}
}
check.dependsOn checkLicense
// rename the top level dir from web3signer-<version> to web3signer and this makes it really
// simple for use in docker
tasks.register("dockerDistUntar") {
dependsOn distTar
def dockerBuildPath = "build/docker-web3signer/"
def distTarFile = distTar.outputs.files.singleFile
def distTarFileName = distTar.outputs.files.singleFile.name.replace(".tar.gz", "")
doFirst {
def dockerBuildDir = new File(dockerBuildPath)
dockerBuildDir.deleteDir()
dockerBuildDir.mkdir()
copy {
from tarTree(distTarFile)
into(dockerBuildPath)
}
def dockerDist = file("${dockerBuildPath}/${distTarFileName}")
dockerDist.renameTo("${dockerBuildPath}/web3signer")
}
}
def dockerImage = "consensys/web3signer"
def dockerJdkVariants = ["jdk21",]
def dockerBuildDir = "build/docker-web3signer/"
task distDocker {
dependsOn dockerDistUntar
def dockerBuildVersion = 'develop'
doLast {
for (def variant in dockerJdkVariants) {
copy {
from file("${projectDir}/docker/${variant}/Dockerfile")
into(dockerBuildDir)
}
exec {
def image = "${dockerImage}:${dockerBuildVersion}-${variant}"
workingDir dockerBuildDir
executable "sh"
args "-c", "docker build --build-arg BUILD_DATE=${buildTime()} --build-arg VERSION=${dockerBuildVersion} --build-arg VCS_REF=${getCheckedOutGitCommitHash()} -t ${image} ."
}
}
// tag the "default" (which is the variant in the zero position)
exec {
executable "sh"
args "-c", "docker tag '${dockerImage}:${dockerBuildVersion}-${dockerJdkVariants[0]}' '${dockerImage}:${dockerBuildVersion}'"
}
}
}
task testDocker {
dependsOn([distDocker])
def dockerBuildVersion = 'develop'
def dockerReportsDir = "docker/reports/"
doFirst {
new File(dockerReportsDir).mkdir()
}
doLast {
exec {
workingDir "docker"
executable "sh"
args "-c", "sh ./test.sh '${dockerImage}:${dockerBuildVersion}'"
}
}
}
def dockerTagPrefixes(String dockerBuildVersion) {
def versionPrefixes = [dockerBuildVersion]
if (project.hasProperty('branch') && project.property('branch') == 'master') {
versionPrefixes.add('develop')
}
// add `latest` tag for non-develop and non-rc versions
if (!rootProject.version.contains('develop') && !rootProject.version.toLowerCase().contains('-rc')) {
versionPrefixes.add('latest')
// when docker build version is x.y.[a,b..] we would also like to use tag x.y
versionPrefixes.add(dockerBuildVersion.split(/\./)[0..1].join('.'))
}
return versionPrefixes
}
task uploadDocker {
dependsOn([distDocker])
def dockerBuildVersion = "${rootProject.version}".replace('+', '-')
def architecture = System.getenv('architecture')
def platform = System.getenv('platform')
def versionPrefixes = dockerTagPrefixes(dockerBuildVersion)
doLast {
for (def variant in dockerJdkVariants) {
def tags = ""
versionPrefixes.forEach { prefix -> tags += "-t ${dockerImage}:${prefix.trim()}-${variant}-${architecture} "}
if (variant == dockerJdkVariants[0]) {
versionPrefixes.forEach { prefix -> tags += "-t ${dockerImage}:${prefix.trim()}-${architecture} "}
}
copy {
from file("${projectDir}/docker/${variant}/Dockerfile")
into(dockerBuildDir)
}
exec {
workingDir dockerBuildDir
executable "sh"
args "-c", "docker build --platform ${platform} --build-arg BUILD_DATE=${buildTime()} --build-arg VERSION=${dockerBuildVersion} --build-arg VCS_REF=${getCheckedOutGitCommitHash()} ${tags} ."
}
//docker trust sign runs one image at a time, so we have to remove the '-t' in the string and split into a list we can use
def trustTags = tags.replaceAll( '-t ', '' ).trim().split(' ')
for (def t in trustTags) {
exec {
workingDir dockerBuildDir
executable "sh"
args "-c", "docker trust sign ${t} && docker push ${t} "
}
}
}
}
}
task manifestDocker {
def dockerBuildVersion = "${rootProject.version}".replace('+', '-')
def versionPrefixes = dockerTagPrefixes(dockerBuildVersion)
def platforms = ["arm64", "amd64"]
doLast {
for (def variant in dockerJdkVariants) {
def tags = []
def cmd = ""
versionPrefixes.forEach { prefix -> tags.add("${dockerImage}:${prefix.trim()}-${variant}") }
if (variant == dockerJdkVariants[0]) {
versionPrefixes.forEach { prefix -> tags.add("${dockerImage}:${prefix.trim()}") }
}
for (def tag in tags) {
platforms.forEach { platform -> cmd += "${tag}-${platform} " }
exec {
executable "sh"
args "-c", "docker manifest create ${tag} ${cmd} && docker manifest push ${tag}"
}
}
}
}
}
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
additionalSourceDirs.from files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.from files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.from files(subprojects.sourceSets.main.output)
executionData.from files(subprojects.jacocoTestReport.executionData) //how to exclude some package/classes com.test.**
reports {
xml.required = true
csv.required = true
html.destination file("build/reports/jacocoHtml")
}
onlyIf = { true }
doFirst {
executionData = files(executionData.findAll { it.exists() })
}
}
configurations { annotationProcessor }
// http://label-schema.org/rc1/
// using the RFC3339 format "2016-04-12T23:20:50.52Z"
def buildTime() {
def df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'")
df.setTimeZone(TimeZone.getTimeZone("UTC"))
return df.format(new Date())
}
// Calculate the version that this build would be published under (if it is published)
// If this exact commit is tagged, use the tag
// If this is on a release-* branch, use the most recent tag appended with +develop (e.g. 0.1.1-RC1+develop)
// Otherwise, use develop
def calculatePublishVersion() {
if (!grgit) {
return 'develop'
}
def specificVersion = calculateVersion()
def isReleaseBranch = grgit.branch.current().name.startsWith('release-')
if (specificVersion.contains('+')) {
return isReleaseBranch ? "${specificVersion.substring(0, specificVersion.indexOf('+'))}+develop" : "develop"
}
return specificVersion
}
// Calculate the version that teku --version will report (among other places)
// If this exact commit is tagged, use the tag
// Otherwise use git describe --tags and replace the - after the tag with a +
@Memoized
def calculateVersion() {
if (!grgit) {
logger.warn("Not building from a git checkout. Version information will not be available. Building from a git checkout is strongly recommended.")
return 'UNKNOWN+develop'
}
String version = grgit.describe(tags: true)
if (version == null) {
return "UNKNOWN+g${grgit.head().abbreviatedId}"
}
def versionPattern = ~/^(?<lastVersion>.*)-(?<devVersion>[0-9]+-g[a-z0-9]+)$/
def matcher = version =~ versionPattern
if (matcher.find()) {
return "${matcher.group("lastVersion")}+${matcher.group("devVersion")}"
}
return version
}
task printVersion() {
doFirst {
print "Specific version: ${specificVersion} Publish version: ${project.version}"
}
}
def getCheckedOutGitCommitHash() {
def takeFromHash = 8
grgit ? grgit.head().id.take(takeFromHash) : 'UNKNOWN'
}
task releaseIntegrationTest(type: Test){
for(TaskContainer taskList : subprojects.tasks){
def subProjectIntegrationTask = taskList.findByName('integrationTest')
if (subProjectIntegrationTask != null) {
dependsOn subProjectIntegrationTask
}
}
}
task releaseAcceptanceTest(type: Test, dependsOn : ':acceptance-tests:acceptanceTest') {}
task cloudsmithUpload {
dependsOn([distTar, distZip,])
doLast {
exec {
executable project.file("scripts/cloudsmith-upload.sh")
args rootProject.version, "${buildDir}/distributions"
}
}
}
def calculateJarName(Project project) {
def jarName = project.name
def parent = project.parent
while (parent != null) {
if (parent != rootProject) {
jarName = parent.name + '-' + jarName
}
parent = parent.parent
}
return jarName
}