This repository has been archived by the owner on Jul 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 232
/
build.gradle
214 lines (177 loc) Β· 6.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id "org.jruyi.thrift" version "0.4.0"
id "jacoco"
id "com.github.hierynomus.license" version "0.15.0"
id "com.github.johnrengelman.shadow" version "5.0.0"
id "net.ltgt.errorprone" version "0.0.14"
id 'ru.vyarus.animalsniffer' version '1.5.0'
id 'java-library'
id 'maven-publish'
id 'signing'
id 'io.codearte.nexus-staging' version '0.20.0'
id "de.marcphilipp.nexus-publish" version "0.2.0" apply false
id 'com.github.ben-manes.versions' version '0.21.0'
id 'net.researchgate.release' version '2.6.0'
}
ext.opentracingVersion = getProperty('opentracingVersion','0.33.0')
ext.guavaVersion = getProperty('guavaVersion','18.0')
ext.apacheThriftVersion = getProperty('apacheThriftVersion','0.15.0')
ext.jerseyVersion = getProperty('jerseyVersion','2.22.2')
ext.slf4jVersion = getProperty('slf4jVersion','1.7.28')
ext.gsonVersion = getProperty('gsonVersion','2.9.0')
ext.tracerResolverVersion = getProperty('tracerResolverVersion','0.1.8')
ext.micrometerVersion = getProperty('micrometerVersion','1.2.0')
ext.okhttpVersion = getProperty('okhttpVersion','4.9.3')
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()
allprojects {
apply plugin: 'idea' // intellij support
apply plugin: 'jacoco'
group = 'io.jaegertracing'
repositories {
mavenLocal()
mavenCentral()
}
}
def getRepositoryUsername() {
return hasProperty('ossrhUsername') ? ossrhUsername : ""
}
def getRepositoryPassword() {
return hasProperty('ossrhPassword') ? ossrhPassword : ""
}
subprojects {
apply plugin: 'ru.vyarus.animalsniffer'
apply plugin: 'com.github.hierynomus.license'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'checkstyle'
apply plugin: 'de.marcphilipp.nexus-publish'
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
jar {
from sourceSets.main.output
}
if (!version.endsWith("SNAPSHOT")) {
nexusStaging {
packageGroup = "io.jaegertracing"
username = getRepositoryUsername()
password = getRepositoryPassword()
// Dealing with error "Wrong number of received repositories in state 'open'" (http://bit.ly/2ybracm)
numberOfRetries = 50
delayBetweenRetriesInMillis = 3000
}
publish.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.20'
compileOnly 'org.projectlombok:lombok:1.18.20'
compileOnly 'org.codehaus.mojo:animal-sniffer-annotations:1.20'
}
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 project.version
}
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 getProperty(name, defaultValue) {
project.properties[name] ?: defaultValue
}
release {
git {
requireBranch = 'master|release-.*'
}
// default is x.x.x
tagTemplate = "v" + project.properties["release.releaseVersion"]
}