-
Notifications
You must be signed in to change notification settings - Fork 356
/
build.gradle
144 lines (121 loc) · 3.59 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
buildscript {
repositories {
jcenter()
//Add only for SNAPSHOT versions
//maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.21.1"
}
}
plugins {
id 'java'
id 'maven'
id 'jacoco'
id 'io.franzbecker.gradle-lombok' version '3.2.0'
id "com.diffplug.gradle.spotless" version "3.24.3"
id "net.ltgt.errorprone" version "0.8.1"
id 'com.github.kt3k.coveralls' version '2.8.4'
id 'biz.aQute.bnd.builder' version '4.2.0'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = GROUP
version = VERSION_NAME
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-Xlint:-options" << "-Xlint:-processing"
options.encoding = 'UTF-8'
options.errorprone {
// This check is broken in Java 12. See https://github.com/google/error-prone/issues/1257
if ((JavaVersion.current().majorVersion as Integer) > 11) {
check('Finally', net.ltgt.gradle.errorprone.CheckSeverity.OFF)
}
}
}
compileJava {
options.compilerArgs << "-Werror"
}
configurations.all {
}
repositories {
jcenter()
}
dependencies {
compile group: 'com.google.code.gson', name: 'gson', version:'2.8.5'
errorprone group: 'com.google.errorprone', name: 'error_prone_core', version: '2.3.3'
errorproneJavac group: 'com.google.errorprone', name: 'javac', version:'9+181-r4173-1'
testCompile group: 'com.google.guava', name: 'guava', version:'28.1-jre'
testCompile group: 'org.mockito', name: 'mockito-core', version:'3.0.0'
testRuntime group: 'org.slf4j', name: 'slf4j-api', version: '1.7.28'
testImplementation group: 'com.squareup.okhttp3', name: 'mockwebserver', version: '4.2.0'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.2'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.5.2'
}
jar {
manifest {
attributes("Implementation-Title": POM_NAME,
"Implementation-Version": VERSION_NAME,
"Implementation-Vendor": VENDOR_NAME,
"Bundle-SymbolicName": POM_ARTIFACT_ID,
"Export-Package": 'com.stripe.*')
version = VERSION_NAME
}
}
lombok {
version = "1.18.10"
sha256 = ""
}
import io.franzbecker.gradle.lombok.task.DelombokTask
task delombok(type: DelombokTask, dependsOn: compileJava) {
ext.outputDir = file("$buildDir/delombok/main")
outputs.dir(outputDir)
sourceSets.main.java.srcDirs.each {
inputs.dir(it)
args(it, "-d", outputDir)
}
doFirst {
outputDir.deleteDir()
}
}
task delombokTest(type: DelombokTask, dependsOn: compileJava) {
ext.outputDir = file("$buildDir/delombok/test")
outputs.dir(outputDir)
sourceSets.test.java.srcDirs.each {
inputs.dir(it)
args(it, "-d", outputDir)
}
doFirst {
outputDir.deleteDir()
}
}
task delombokHelp(type: DelombokTask) {
args "--help"
}
javadoc {
dependsOn delombok
source = delombok.outputDir
failOnError = true
}
apply from: 'deploy.gradle'
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
}
spotless {
java {
googleJavaFormat('1.7')
removeUnusedImports()
}
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
coveralls {
jacocoReportPath 'build/reports/jacoco/test/jacocoTestReport.xml'
}