forked from stripe/stripe-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
149 lines (128 loc) · 4.65 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
buildscript {
repositories {
mavenCentral()
//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.30.0"
}
}
plugins {
id "java"
id "maven-publish"
id "signing"
id "jacoco"
id "io.freefair.lombok" version "6.3.0"
id "com.diffplug.spotless" version "6.0.1"
// id "net.ltgt.errorprone" version "2.0.2"
id "com.github.kt3k.coveralls" version "2.12.0"
id "biz.aQute.bnd.builder" version "6.1.0"
id "org.ajoberstar.git-publish" version "3.0.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"
// NOTE errorprone throws exception
// options.errorprone {
// // This check causes warnings with autogenerated Javadoc strings.
// check("InvalidParam", net.ltgt.gradle.errorprone.CheckSeverity.OFF)
//
// // Some methods in autogen'd files (defined via overrides) lack a summary. Should be trivial
// // to fix by adding the missing summaries.
// check("MissingSummary", net.ltgt.gradle.errorprone.CheckSeverity.OFF)
//
// // This check is disabled because multiple nested classes may have the same name in a given
// // file. E.g. in `main/java/com/stripe/param/AccountUpdateParams.java`:
// // The name `Address` refers to [com.stripe.param.AccountUpdateParams.Company.Address,
// // com.stripe.param.AccountUpdateParams.Individual.Address] within this file.)
// // We should fix this by having autogen use the fully-qualified class to eliminate ambiguity.
// check("SameNameButDifferent", net.ltgt.gradle.errorprone.CheckSeverity.OFF)
// }
}
compileJava {
options.compilerArgs << "-Werror"
}
configurations.all {
}
repositories {
mavenCentral()
}
dependencies {
// errorprone group: "com.google.errorprone", name: "error_prone_core", version: "2.10.0"
// errorproneJavac group: "com.google.errorprone", name: "javac", version:"9+181-r4173-1"
implementation group: "com.google.code.gson", name: "gson", version:"2.8.9"
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.35'
implementation 'org.slf4j:slf4j-simple:1.7.35'
testImplementation group: "com.google.guava", name: "guava", version:"31.0.1-jre"
testImplementation group: "com.squareup.okhttp3", name: "mockwebserver", version: "4.9.1"
testImplementation group: "org.mockito", name: "mockito-core", version:"4.1.0"
testImplementation group: "org.junit.jupiter", name: "junit-jupiter-api", version: "5.8.2"
testRuntimeOnly group: "org.junit.jupiter", name: "junit-jupiter-engine", version: "5.8.2"
testRuntimeOnly group: "org.slf4j", name: "slf4j-api", version: "1.7.32"
}
jar {
manifest {
attributes("Implementation-Title": POM_NAME,
"Implementation-Version": VERSION_NAME,
"Implementation-Vendor": VENDOR_NAME,
"Bundle-SymbolicName": POM_ARTIFACT_ID,
"Export-Package": "com.stripe.*")
archiveVersion = VERSION_NAME
}
}
lombok {
version = "1.18.22"
}
delombok {
// empty format option, otherwise the default is to use pretty formatting which overrides
// options Lombok config options and does not add generated annotations.
format = [:]
}
apply from: "deploy.gradle"
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
}
//spotless {
// java {
// googleJavaFormat("1.7") // 1.7 is the last version that supports Java 8
// removeUnusedImports()
// }
//}
jacocoTestReport {
reports {
xml.required = true // coveralls plugin depends on xml format report
html.required = true
}
}
coveralls {
jacocoReportPath "build/reports/jacoco/test/jacocoTestReport.xml"
}
//javadoc {
// doFirst {
// // We should remove this once we start using module-info.java.
// // Without that file, Javadoc will fall back to "undefined" as the module
// // name resulting in broken search links. This option explicitly declares
// // that we are not currently using modules and the module name should be
// // omitted from Javadoc.
// options.addBooleanOption('-no-module-directories', true)
// }
//}
gitPublish {
repoUri = '[email protected]:stripe/stripe-java.git'
branch = 'gh-pages'
sign = false // disable commit signing
contents {
from(javadoc) {
into '.'
}
}
}