forked from google/tsunami-security-scanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
215 lines (193 loc) · 8.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
// Current gradle version 6.5.
plugins {
id 'net.ltgt.errorprone' apply false
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: "signing"
apply plugin: 'net.ltgt.errorprone'
group = 'com.google.tsunami'
version = '0.0.3-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.7'
classGraphVersion = '4.8.65'
errorproneVersion = '2.4.0'
floggerVersion = '0.5.1'
googleCloudStorageVersion = '1.103.1'
guavaVersion = '28.2-jre'
guiceVersion = '4.2.3'
grpcVersion = '1.29.0'
gsonVersion = '2.8.5'
jaxbVersion = '2.3.1'
javaxInjectVersion = '1'
jcommanderVersion = '1.48'
jsoupVersion = '1.9.2'
okhttpVersion = '3.12.0'
protobufVersion = '3.11.4'
protocVersion = protobufVersion
snameyamlVersion = '1.26'
junitVersion = '4.13'
mockitoVersion = '2.28.2'
truthVersion = '1.0.1'
// 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}",
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}",
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}",
okhttp: "com.squareup.okhttp3:okhttp:${okhttpVersion}",
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:${snameyamlVersion}",
// 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}",
]
}
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 = 1.8
targetCompatibility = 1.8
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'
}
}
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
}
}
}
}
}
}