forked from jaegertracing/jaeger-client-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
215 lines (175 loc) · 6.14 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import java.util.regex.Pattern
plugins {
id "org.jruyi.thrift" version "0.4.0"
id "jacoco"
id "com.github.hierynomus.license" version "0.14.0"
id 'com.github.sherter.google-java-format' version '0.6'
id "com.github.johnrengelman.shadow" version "2.0.4"
id "net.ltgt.errorprone" version "0.0.14"
id 'ru.vyarus.animalsniffer' version '1.4.3'
id 'io.codearte.nexus-staging' version '0.11.0'
id 'com.github.ben-manes.versions' version '0.17.0'
}
ext.developmentVersion = getProperty('developmentVersion','0.31.1-SNAPSHOT')
ext.opentracingVersion = getProperty('opentracingVersion','0.31.0')
ext.guavaVersion = getProperty('guavaVersion','18.0')
ext.apacheThriftVersion = getProperty('apacheThriftVersion','0.11.0')
ext.jerseyVersion = getProperty('jerseyVersion','2.22.2')
ext.slf4jVersion = getProperty('slf4jVersion','1.7.25')
ext.gsonVersion = getProperty('gsonVersion','2.8.2')
ext.tracerResolverVersion = getProperty('tracerResolverVersion','0.1.5')
ext.micrometerVersion = getProperty('micrometerVersion','1.0.0')
ext.okhttpVersion = getProperty('okhttpVersion','3.9.0')
ext.junitVersion = '4.12'
ext.mockitoVersion = '2.12.0'
ext.powermockitoVersion = '1.7.0'
ext.junitDataProviderVersion = '1.13.1'
ext.awaitilityVersion = '3.0.0'
ext.logbackVersion = '1.2.3'
ext.skipSigning = project.hasProperty('skipSigning') && skipSigning.toBoolean()
task wrapper(type: Wrapper) {
gradleVersion = '4.0'
}
allprojects {
apply plugin: 'idea' // intellij support
apply plugin: 'jacoco'
group = 'io.jaegertracing'
version = getVersionForBuild()
repositories {
mavenLocal()
mavenCentral()
}
}
subprojects {
apply plugin: 'ru.vyarus.animalsniffer'
apply plugin: 'com.github.hierynomus.license'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'checkstyle'
compileJava {
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
jar {
from sourceSets.main.output
}
if (!version.endsWith("SNAPSHOT")) {
nexusStaging {
packageGroup = "io.jaegertracing"
username = ossrhUsername
password = ossrhPassword
// Dealing with error "Wrong number of received repositories in state 'open'" (http://bit.ly/2ybracm)
numberOfRetries = 50
delayBetweenRetriesInMillis = 3000
}
uploadArchives.finalizedBy closeAndReleaseRepository
}
animalsniffer {
sourceSets = [sourceSets.main]
}
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
task listJars {
doLast {
configurations.compile.each { File file -> println file.name }
}
}
checkstyle {
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
toolVersion = "7.6.1"
configProperties.checkstyleSuppressions = "${rootProject.rootDir}/config/checkstyle/suppressions.xml"
}
license {
header rootProject.file('license-template')
skipExistingHeaders true
strictCheck true
include "**/*.java"
ext.year = Calendar.getInstance().get(Calendar.YEAR)
ext.name = 'The Jaeger Authors'
ignoreFailures = false
mapping {
java = 'SLASHSTAR_STYLE'
}
}
check.dependsOn tasks.license
apply from: '../gradle/publish.gradle'
test {
testLogging {
events TestLogEvent.FAILED, TestLogEvent.SKIPPED
exceptionFormat TestExceptionFormat.FULL
// remove standard output/error logging from --info builds
info.events = [
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED
]
info.exceptionFormat TestExceptionFormat.FULL
}
}
dependencies {
annotationProcessor 'org.projectlombok:lombok:1.18.2'
compileOnly 'org.projectlombok:lombok:1.18.2'
compileOnly 'org.codehaus.mojo:animal-sniffer-annotations:1.16'
}
signing {
required { !skipSigning }
}
}
task codeCoverageReport(type: JacocoReport, group: 'Coverage reports') {
dependsOn(subprojects*.test)
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
html.enabled = true
xml.enabled = true
xml.destination = file("${buildDir}/reports/jacoco/report.xml")
}
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ['**/crossdock/**',
'**/thrift/**',
'**/thriftjava/**',
])
})
}
}
task printVersion {
println getVersionForBuild()
}
configure(subprojects.findAll {it.name != 'jaeger-thrift'}) {
apply plugin: 'net.ltgt.errorprone'
dependencies {
errorprone 'com.google.errorprone:error_prone_core:2.1.1'
}
tasks.withType(JavaCompile) {
// These are disabled because of a bug with errorprone. See https://github.com/google/error-prone/issues/750
options.compilerArgs += [ '-Xep:NestedInstanceOfConditions:OFF', '-Xep:InstanceOfAndCastMatchWrongType:OFF' ]
}
tasks.withType(Jar) {
manifest {
attributes('Implementation-Title': project.name, 'Implementation-Version': project.version, 'Specification-Version': project.version)
}
}
}
def getVersionForBuild() {
String candidateVersion = System.env.TRAVIS_TAG
if (null == candidateVersion || candidateVersion.isEmpty()) {
return ext.developmentVersion
}
if (Pattern.compile("[v]?((\\d+)\\.(\\d+)\\.(\\d+))(\\-RC\\d+)?").matcher(candidateVersion).matches()) {
return candidateVersion.drop(1)
}
return ext.developmentVersion
}
def getProperty(name, defaultValue) {
project.properties[name] ?: defaultValue
}