-
Notifications
You must be signed in to change notification settings - Fork 894
/
build.gradle
256 lines (232 loc) · 10.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
// Current gradle version 6.5.
plugins {
id 'net.ltgt.errorprone' apply false
id "com.github.johnrengelman.shadow"
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: "signing"
apply plugin: 'net.ltgt.errorprone'
apply plugin: 'com.github.johnrengelman.shadow'
group = 'com.google.tsunami'
version = '0.0.25-SNAPSHOT' // Current Tsunami version
repositories {
maven { // The google mirror is less flaky than mavenCentral()
url 'https://maven-central.storage-download.googleapis.com/repos/central/data/'
}
mavenCentral()
mavenLocal()
}
ext {
// All dependency versions.
autoValueVersion = '1.10.4'
classGraphVersion = '4.8.65'
errorproneVersion = '2.4.0'
floggerVersion = '0.5.1'
googleCloudStorageVersion = '1.103.1'
googleHttpClientVersion = '1.44.1'
guavaVersion = '28.2-jre'
guiceVersion = '6.0.0'
grpcVersion = '1.60.0'
gsonVersion = '2.8.6'
jaxbVersion = '2.3.1'
javaxAnnotationVersion = '1.3.2'
javaxInjectVersion = '1'
jcommanderVersion = '1.48'
jsoupVersion = '1.9.2'
libajpVersion = '1.0.0'
mysqlVersion='8.0.33'
okhttpVersion = '3.12.0'
postgresqlVersion = '42.6.0'
protobufVersion = '3.25.2'
protocVersion = protobufVersion
snakeyamlVersion = '1.26'
junitVersion = '4.13'
mockitoVersion = '5.12.0'
truthVersion = '1.4.0'
tcsVersion = '0.0.1'
hiveVersion = '2.3.2'
// All Tsunami dependencies.
deps = [
autovalue: "com.google.auto.value:auto-value-annotations:${autoValueVersion}",
autovalue_annotation_processor: "com.google.auto.value:auto-value:${autoValueVersion}",
classgraph: "io.github.classgraph:classgraph:${classGraphVersion}",
errorprone: "com.google.errorprone:error_prone_annotations:${errorproneVersion}",
flogger: "com.google.flogger:flogger:${floggerVersion}",
flogger_google_ext: "com.google.flogger:google-extensions:${floggerVersion}",
flogger_backend: "com.google.flogger:flogger-system-backend:${floggerVersion}",
google_cloud_storage: "com.google.cloud:google-cloud-storage:${googleCloudStorageVersion}",
google_http_client: "com.google.http-client:google-http-client:${googleHttpClientVersion}",
guava: "com.google.guava:guava:${guavaVersion}",
guice: "com.google.inject:guice:${guiceVersion}",
guice_assisted: "com.google.inject.extensions:guice-assistedinject:${guiceVersion}",
grpc_protobuf: "io.grpc:grpc-protobuf:${grpcVersion}",
grpc_context: "io.grpc:grpc-context:${grpcVersion}",
grpc_stub: "io.grpc:grpc-stub:${grpcVersion}",
grpc_core: "io.grpc:grpc-core:${grpcVersion}",
grpc_services: "io.grpc:grpc-services:${grpcVersion}",
grpc_testing: "io.grpc:grpc-testing:${grpcVersion}",
grpc_netty: "io.grpc:grpc-netty:${grpcVersion}",
javax_annotations: "javax.annotation:javax.annotation-api:${javaxAnnotationVersion}",
gson: "com.google.code.gson:gson:${gsonVersion}",
jaxb_runtime: "org.glassfish.jaxb:jaxb-runtime:${jaxbVersion}",
javax_inject: "javax.inject:javax.inject:${javaxInjectVersion}",
jcommander: "com.beust:jcommander:${jcommanderVersion}",
jsoup: "org.jsoup:jsoup:${jsoupVersion}",
libajp: "com.doyensec:libajp:${libajpVersion}",
mysql: "com.mysql:mysql-connector-j:${mysqlVersion}",
okhttp: "com.squareup.okhttp3:okhttp:${okhttpVersion}",
postgresql:"org.postgresql:postgresql:${postgresqlVersion}",
protobuf: "com.google.protobuf:protobuf-java:${protobufVersion}",
protobuf_lite: "com.google.protobuf:protobuf-javalite:${protobufVersion}",
protobuf_util: "com.google.protobuf:protobuf-java-util:${protobufVersion}",
snakeyaml: "org.yaml:snakeyaml:${snakeyamlVersion}",
tcs_common: "com.google.tsunami:tcs-common:${tcsVersion}",
tcs_proto: "com.google.tsunami:tcs-proto:${tcsVersion}",
hive: "org.apache.hive:hive-jdbc:${hiveVersion}",
// Test dependencies.
guava_testlib: "com.google.guava:guava-testlib:${guavaVersion}",
junit: "junit:junit:${junitVersion}",
mockito: "org.mockito:mockito-core:${mockitoVersion}",
mock_web_server: "com.squareup.okhttp3:mockwebserver:${okhttpVersion}",
truth: "com.google.truth:truth:${truthVersion}",
truth8: "com.google.truth.extensions:truth-java8-extension:${truthVersion}",
truth_protobuf: "com.google.truth.extensions:truth-proto-extension:${truthVersion}",
]
}
// Resolving conflicting NameResolverProvider from grpc-core.jar and
// grpc-netty-shaded.jar, https://github.com/grpc/grpc-java/issues/10853
shadowJar {
zip64 true
mergeServiceFiles()
}
if (rootProject.properties.get('errorProne', true)) {
dependencies {
errorprone "com.google.errorprone:error_prone_core:${errorproneVersion}"
errorproneJavac 'com.google.errorprone:javac:9+181-r4173-1'
}
// Disable ErrorProne for all generated codes.
tasks.withType(JavaCompile).configureEach {
options.errorprone.disableWarningsInGeneratedCode = false
options.errorprone.excludedPaths = '.*/build/generated/.*'
}
} else {
// Disable Error Prone
allprojects {
afterEvaluate { project ->
project.tasks.withType(JavaCompile) {
options.errorprone.enabled = false
}
}
}
}
plugins.withId('java') {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
java.withJavadocJar()
java.withSourcesJar()
jar.manifest {
attributes('Implementation-Title': name,
'Implementation-Version': version,
'Built-By': System.getProperty('user.name'),
'Built-JDK': System.getProperty('java.version'),
'Source-Compatibility': sourceCompatibility,
'Target-Compatibility': targetCompatibility)
}
javadoc.options {
encoding = 'UTF-8'
use = true
links 'https://docs.oracle.com/javase/8/docs/api/'
source = '8'
}
// Log stacktrace to console when test fails.
test {
testLogging {
exceptionFormat = 'full'
showExceptions true
showCauses true
showStackTraces true
}
maxHeapSize = '1500m'
}
// See the changelog of Guava for reasons why we need this:
// https://github.com/google/guava/releases/tag/v32.1.0
sourceSets.all {
configurations.getByName(runtimeClasspathConfigurationName) {
attributes.attribute(Attribute.of("org.gradle.jvm.environment", String), "standard-jvm")
}
configurations.getByName(compileClasspathConfigurationName) {
attributes.attribute(Attribute.of("org.gradle.jvm.environment", String), "standard-jvm")
}
}
}
plugins.withId('maven-publish') {
publishing {
publications {
maven(MavenPublication) {
from components.java
pom {
name = project.group + ':' + project.name
url = 'https://github.com/google/tsunami-security-scanner'
afterEvaluate {
// description is not available until evaluated.
description = project.description
}
licenses {
license {
name = 'Apache 2.0'
url = 'https://opensource.org/licenses/Apache-2.0'
}
}
scm {
connection = 'scm:git:https://github.com/google/tsunami-security-scanner.git'
developerConnection = 'scm:git:[email protected]:google/tsunami-security-scanner.git'
url = 'https://github.com/google/tsunami-security-scanner'
}
developers {
developer {
id = 'com.google.tsunami'
name = 'Tsunami Contributors'
email = '[email protected]'
url = 'https://github.com/google/tsunami-security-scanner'
organization = 'Tsunami Authors'
organizationUrl = 'https://www.google.com'
}
}
}
}
}
repositories {
maven {
def stagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def releaseUrl = stagingUrl
def snapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotUrl : releaseUrl
credentials {
if (rootProject.hasProperty('ossrhUsername')
&& rootProject.hasProperty('ossrhPassword')) {
username = rootProject.ossrhUsername
password = rootProject.ossrhPassword
}
}
}
mavenLocal()
}
}
signing {
required false
sign publishing.publications.maven
}
plugins.withId('com.github.johnrengelman.shadow') {
publishing {
publications {
maven {
artifact project.tasks.shadowJar
}
}
}
}
}
}