forked from stripe/stripe-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
113 lines (92 loc) · 2.6 KB
/
build.gradle
File metadata and controls
113 lines (92 loc) · 2.6 KB
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
buildscript {
repositories {
jcenter()
//Add only for SNAPSHOT versions
//maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.11.0"
}
}
plugins {
id 'java'
id 'maven'
id 'io.franzbecker.gradle-lombok' version '1.14'
id 'checkstyle'
id 'net.saliman.cobertura' version '2.5.4'
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'osgi'
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
group = GROUP
version = VERSION_NAME
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-Xlint:-options" << "-Xlint:-processing"
options.encoding = 'UTF-8'
}
compileJava {
options.compilerArgs << "-Werror"
}
configurations.all {
}
repositories {
jcenter()
}
dependencies {
compile group: 'com.google.code.gson', name: 'gson', version:'2.8.5'
testCompile group: 'com.google.guava', name: 'guava', version:'26.0-android' // Use Android flavor for JDK7 compatiblity
testCompile group: 'junit', name: 'junit', version:'4.12'
testCompile group: 'org.mockito', name: 'mockito-core', version:'2.22.0'
testRuntime group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
testImplementation 'com.squareup.okhttp3:mockwebserver:3.12.1'
}
jar {
manifest {
attributes("Implementation-Title": POM_NAME,
"Implementation-Version": VERSION_NAME,
"Implementation-Vendor": VENDOR_NAME)
version = VERSION_NAME
symbolicName = POM_ARTIFACT_ID
instruction 'Export-Package', '*'
}
}
lombok {
version = "1.18.2"
sha256 = ""
}
import io.franzbecker.gradle.lombok.task.DelombokTask
task delombok(type: DelombokTask, dependsOn: compileJava) {
ext.outputDir = file("$buildDir/delombok")
outputs.dir(outputDir)
sourceSets.main.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 {
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
}
checkstyle {
toolVersion = '8.16'
}
cobertura {
coverageFormats = ['html', 'xml'] // coveralls plugin depends on xml format report
coverageIgnoreTrivial = true // ignore getters/setters in coverage report
coverageIgnoreMethodAnnotations = ["java.lang.Deprecated", "lombok.Generated"]
}