forked from jaegertracing/jaeger-client-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
192 lines (156 loc) · 5.09 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
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.1"
id "net.ltgt.errorprone" version "0.0.12"
id 'ru.vyarus.animalsniffer' version '1.4.2'
id 'io.codearte.nexus-staging' version '0.11.0'
id 'com.github.ben-manes.versions' version '0.17.0'
}
ext.developmentVersion = '0.22.0-SNAPSHOT'
ext.opentracingVersion = '0.30.0'
ext.guavaVersion = '18.0'
ext.apacheThriftVersion = '0.9.2'
ext.jerseyVersion = '2.22.2'
ext.slf4jVersion = '1.7.25'
ext.gsonVersion = '2.8.2'
ext.tracerResolverVersion = '0.1.3'
ext.junitVersion = '4.12'
ext.mockitoVersion = '2.12.0'
ext.junitDataProviderVersion = '1.13.1'
ext.awaitilityVersion = '3.0.0'
ext.logbackVersion = '1.2.3'
ext.braveHttpVersion = '4.9.1'
task wrapper(type: Wrapper) {
gradleVersion = '4.0'
}
allprojects {
apply plugin: 'idea' // intellij support
apply plugin: 'jacoco'
group = 'com.uber.jaeger'
version = getVersionForBuild()
repositories {
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
manifest {
attributes('Implementation-Title': project.name, 'Implementation-Version': project.version)
}
}
if (!version.endsWith("SNAPSHOT")) {
nexusStaging {
packageGroup = "com.uber"
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 "failed"
exceptionFormat "full"
// remove standard output/error logging from --info builds
// by assigning only 'failed' and 'skipped' events
info.events = ["failed", "skipped"]
}
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.16.18'
compileOnly 'org.codehaus.mojo:animal-sniffer-annotations:1.16'
}
}
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' ]
}
}
def getVersionForBuild() {
String candidateVersion = System.env.TRAVIS_TAG
if (null == candidateVersion || candidateVersion.isEmpty()) {
return ext.developmentVersion
}
if (Pattern.compile("[v]?((\\d+)\\.(\\d+)\\.(\\d+))").matcher(candidateVersion).matches()) {
return candidateVersion.drop(1)
}
return ext.developmentVersion
}