-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
173 lines (149 loc) · 6.87 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
// Build Script Classpath
buildscript {
ext {
springBootVersion = '3.1.7'
springDependencyManagementVersion = '1.1.4'
}
}
plugins {
id 'idea'
id 'jacoco'
id 'java'
id 'com.diffplug.spotless' version '6.16.0'
id 'com.github.spotbugs' version '5.0.13'
id 'com.github.ben-manes.versions' version '0.42.0'
id 'com.google.cloud.tools.jib' version '3.3.0'
id 'de.undercouch.download' version '5.2.1'
id 'org.hidetake.swagger.generator' version '2.19.2'
id 'org.sonarqube' version '4.0.0.2929'
id "org.springframework.boot" version "${springBootVersion}"
id "io.spring.dependency-management" version "${springDependencyManagementVersion}"
}
allprojects {
group = gradle.projectGroup
version = gradle.janitorVersion
ext {
artifactGroup = "${group}.janitor"
swaggerOutputDir = "${buildDir}/generated"
resourceDir = "${rootDir}/src/main/resources"
isCiServer = System.getenv().containsKey("CI")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
apply plugin: 'idea'
idea {
module {
generatedSourceDirs = [file("${swaggerOutputDir}/src/main/java")]
downloadJavadoc = true
}
}
}
// If true, search local repository (~/.m2/repository/) first for dependencies.
def useMavenLocal = false
repositories {
if (useMavenLocal) {
mavenLocal() // must be listed first to take effect
}
mavenCentral()
maven {
url 'https://broadinstitute.jfrog.io/broadinstitute/libs-release/'
}
maven {
url 'https://broadinstitute.jfrog.io/broadinstitute/libs-snapshot-local/'
}
}
dependencies {
// Common utils
implementation group: 'org.apache.commons', name: 'commons-dbcp2'
implementation group: 'org.apache.commons', name: 'commons-lang3'
implementation group: 'org.apache.commons', name: 'commons-pool2'
// Spring
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jdbc'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web'
annotationProcessor group: 'org.springframework.boot', name: 'spring-boot-configuration-processor'
// Misc. Services
implementation group: 'org.webjars', name: 'webjars-locator-core', version: '0.52'
implementation group: 'jakarta.validation', name: 'jakarta.validation-api'
implementation group: 'io.projectreactor', name: 'reactor-core', version: '3.4.34'
// Google dependencies
constraints {
implementation group: 'com.google.guava', name: 'guava', version: '31.1-jre' // '-jre' for Java 8 or higher
}
implementation platform('com.google.cloud:libraries-bom:26.28.0') // use common bom
implementation group: 'com.google.auto.value', name: 'auto-value-annotations'
implementation group: 'com.google.cloud', name: 'google-cloud-pubsub'
implementation group: 'com.google.cloud', name: 'google-cloud-iamcredentials'
annotationProcessor group: 'com.google.auto.value', name: 'auto-value', version: '1.9'
// Database
implementation group: 'org.liquibase' , name: 'liquibase-core', version: '4.22.0'
runtimeOnly group: 'org.postgresql', name: 'postgresql', version: '42.7.3'
// Terra libraries
implementation group: 'bio.terra', name: 'terra-common-lib', version: '0.1.9-SNAPSHOT'
implementation group: 'bio.terra', name: 'terra-cloud-resource-lib', version: '1.2.30-SNAPSHOT'
implementation group: 'bio.terra', name: 'workspace-manager-client', version: '0.254.997-SNAPSHOT'
// hk2 is required to use WSM client, but not correctly exposed by the client
implementation group: 'org.glassfish.jersey.inject', name: 'jersey-hk2'
// Kubernetes client
implementation group: 'io.kubernetes', name: 'client-java', version: '18.0.0'
// OpenTelemetry
var openTelemetryVersion = '1.32.0'
implementation "io.opentelemetry:opentelemetry-api:${openTelemetryVersion}"
implementation "io.opentelemetry:opentelemetry-sdk:${openTelemetryVersion}"
implementation "io.opentelemetry:opentelemetry-sdk-common:${openTelemetryVersion}"
implementation "io.opentelemetry:opentelemetry-sdk-metrics:${openTelemetryVersion}"
implementation "io.opentelemetry:opentelemetry-exporter-logging:${openTelemetryVersion}"
implementation "io.opentelemetry:opentelemetry-semconv:1.30.1-alpha"
implementation "io.opentelemetry.instrumentation:opentelemetry-spring-webmvc-6.0:${openTelemetryVersion}-alpha"
implementation "io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:${openTelemetryVersion}"
implementation "io.opentelemetry.instrumentation:opentelemetry-spring-boot:${openTelemetryVersion}-alpha"
implementation "io.opentelemetry:opentelemetry-exporter-prometheus:${openTelemetryVersion}-alpha"
// Google cloud open telemetry exporters
var gcpOpenTelemetryExporterVersion = '0.25.2'
implementation "com.google.cloud.opentelemetry:exporter-trace:${gcpOpenTelemetryExporterVersion}"
implementation "com.google.cloud.opentelemetry:exporter-metrics:${gcpOpenTelemetryExporterVersion}"
// Swagger deps
implementation group: 'io.swagger.core.v3', name: 'swagger-annotations', version: '2.2.2'
runtimeOnly group: 'org.webjars.npm', name: 'swagger-ui-dist', version: '3.36.2'
swaggerCodegen group: 'io.swagger.codegen.v3', name: 'swagger-codegen-cli', version: '3.0.47'
// Test deps
testImplementation 'org.awaitility:awaitility:4.2.0'
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
// Allows us to mock final classes
testImplementation 'org.mockito:mockito-inline:2.13.0'
// Transitive dependency constraints due to security vulnerabilities in prior versions.
// These are not directly included, they are just constrained if they are pulled in as
// transitive dependencies.
constraints {
spotbugs('org.apache.bcel:bcel:6.6.1')
}
}
// for scans
if (hasProperty('buildScan')) {
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
}
def gradleIncDir= "$rootDir/gradle"
apply from: "$gradleIncDir/dependency-locking.gradle"
apply from: "$gradleIncDir/jacoco.gradle"
apply from: "$gradleIncDir/javadoc.gradle"
apply from: "$gradleIncDir/jib.gradle"
apply from: "$gradleIncDir/sonarqube.gradle"
apply from: "$gradleIncDir/spotbugs.gradle"
apply from: "$gradleIncDir/spotless.gradle"
apply from: "$gradleIncDir/swagger-server.gradle"
apply from: "$gradleIncDir/testing.gradle"
tasks.named('dependencies') {
dependsOn(':terra-resource-janitor-client:dependencies')
}
import com.diffplug.gradle.spotless.SpotlessTask
tasks.withType(SpotlessTask) {
it.dependsOn(swaggerSources.server.code)
}
sourceSets.main.java.srcDir "${swaggerOutputDir}/src/main/java"