1
+ import org.springframework.boot.gradle.plugin.SpringBootPlugin
2
+
1
3
import java.text.SimpleDateFormat
2
4
3
5
/*
@@ -57,7 +59,7 @@ allprojects {
57
59
apply plugin : " io.spring.dependency-management"
58
60
dependencyManagement {
59
61
imports {
60
- mavenBom org.springframework.boot.gradle.plugin. SpringBootPlugin. BOM_COORDINATES
62
+ mavenBom SpringBootPlugin . BOM_COORDINATES
61
63
}
62
64
dependencies {
63
65
dependency ' io.swagger.core.v3:swagger-annotations:2.2.20'
@@ -70,12 +72,12 @@ apply from: 'debug.gradle'
70
72
71
73
// skip subproject tasks by default when building jade-data-repo
72
74
subprojects. each { s ->
73
- s. tasks. all {
75
+ s. tasks. configureEach {
74
76
task -> task. enabled = (System . getenv(" ENABLE_SUBPROJECT_TASKS" ) != null )
75
77
}
76
78
}
77
79
78
- def boolean isCiServer = System . getenv(). containsKey(" CI" )
80
+ boolean isCiServer = System . getenv(). containsKey(" CI" )
79
81
80
82
java {
81
83
sourceCompatibility = 17
@@ -88,7 +90,7 @@ if (hasProperty('buildScan')) {
88
90
termsOfServiceAgree = ' yes'
89
91
uploadInBackground = false
90
92
publishAlways()
91
- def project = " " ; def cluster = " " ; def nschunk = " " ;
93
+ def project = " " ; def cluster = " " ; def nschunk = " "
92
94
if (System . getenv(" NAMESPACEINUSE" )) {
93
95
project = " broad-jade-integration"
94
96
cluster = " integration-master"
@@ -392,10 +394,10 @@ swaggerSources {
392
394
}
393
395
}
394
396
395
- task generateVersionFile {
397
+ tasks . register( ' generateVersionFile' ) {
396
398
def properties = new Properties ()
397
399
def versionFile = file " src/main/resources/version.properties"
398
- properties. setProperty(" semVer" , project. version )
400
+ properties. setProperty(" semVer" , project. getVersion() . toString() )
399
401
properties. setProperty(" gitHash" , getGitHash())
400
402
Writer writer = new FileWriter (versionFile, false )
401
403
properties. store(writer, " DO NOT EDIT. Autogenerated by build.gradle." )
@@ -406,7 +408,7 @@ generateGrammarSource {
406
408
arguments + = [" -visitor" , " -long-messages" ]
407
409
}
408
410
409
- task unpack ( type : Copy ) {
411
+ tasks . register( ' unpack ' , Copy ) {
410
412
dependsOn bootJar
411
413
from(zipTree(tasks. bootJar. outputs. files. singleFile))
412
414
into(" build/dependency" )
@@ -469,14 +471,14 @@ jib {
469
471
container. creationTime = buildTime()
470
472
}
471
473
472
- def buildTime () {
474
+ static def buildTime () {
473
475
def df = new SimpleDateFormat (" yyyy-MM-dd'T'HH:mm'Z'" ) // you can change it
474
476
df. setTimeZone(TimeZone . getTimeZone(" UTC" ))
475
477
return df. format(new Date ())
476
478
}
477
479
// jib expects all classes to be under app/classes in the resulting image. this, combined with the extraDirectories
478
480
// setting above will ensure that the generated classes end up in the right place when jib builds.
479
- task setupGeneratedDir ( type : Copy ) {
481
+ tasks . register( ' setupGeneratedDir ' , Copy ) {
480
482
from file(' build/classes/java/generated' )
481
483
into file(' build/gen-expanded/app/classes' )
482
484
}
@@ -529,7 +531,7 @@ test {
529
531
maxParallelForks = 2
530
532
}
531
533
532
- task testConnected ( type : Test ) {
534
+ tasks . register( ' testConnected ' , Test ) {
533
535
useJUnitPlatform {
534
536
includeTags ' bio.terra.common.category.Connected'
535
537
}
@@ -547,7 +549,7 @@ task testConnected(type: Test) {
547
549
maxHeapSize = " 2g"
548
550
}
549
551
550
- task testIntegration ( type : Test ) {
552
+ tasks . register( ' testIntegration ' , Test ) {
551
553
useJUnitPlatform {
552
554
includeTags ' bio.terra.common.category.Integration'
553
555
}
@@ -565,15 +567,15 @@ task testIntegration(type: Test) {
565
567
outputs. upToDateWhen { false }
566
568
}
567
569
568
- task testUnit ( type : Test ) {
570
+ tasks . register( ' testUnit ' , Test ) {
569
571
useJUnitPlatform {
570
572
includeTags ' bio.terra.common.category.Unit'
571
573
}
572
574
maxParallelForks = 2
573
575
outputs. upToDateWhen { false }
574
576
}
575
577
576
- task testOnDemand ( type : Test ) {
578
+ tasks . register( ' testOnDemand ' , Test ) {
577
579
useJUnitPlatform {
578
580
includeTags ' bio.terra.common.category.OnDemand'
579
581
}
@@ -583,15 +585,15 @@ task testOnDemand(type: Test) {
583
585
outputs. upToDateWhen { false }
584
586
}
585
587
586
- task testAll ( type : Test ) {
588
+ tasks . register( ' testAll ' , Test ) {
587
589
useJUnitPlatform {
588
590
// Note: explicitly not including OnDemand tests
589
591
includeTags ' bio.terra.common.category.Connected' , ' bio.terra.common.category.Unit'
590
592
}
591
593
outputs. upToDateWhen { false }
592
594
}
593
595
594
- task verifyPacts ( type : Test ) {
596
+ tasks . register( ' verifyPacts ' , Test ) {
595
597
useJUnitPlatform {
596
598
includeTags ' bio.terra.common.category.Pact'
597
599
}
0 commit comments