-
Notifications
You must be signed in to change notification settings - Fork 354
/
build.gradle
290 lines (249 loc) · 10.3 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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
/*
* Copyright 2015-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'com.github.sherter.google-java-format' version '0.9' apply false
id 'me.champeau.jmh' version '0.7.1' apply false
id 'io.spring.dependency-management' version '1.1.0' apply false
id 'io.morethan.jmhreport' version '0.9.0' apply false
id 'io.github.reyerizo.gradle.jcstress' version '0.8.15' apply false
id 'com.github.vlsi.gradle-extensions' version '1.89' apply false
}
boolean isCiServer = ["CI", "CONTINUOUS_INTEGRATION", "TRAVIS", "CIRCLECI", "bamboo_planKey", "GITHUB_ACTION"].with {
retainAll(System.getenv().keySet())
return !isEmpty()
}
subprojects {
apply plugin: 'io.spring.dependency-management'
apply plugin: 'com.github.sherter.google-java-format'
apply plugin: 'com.github.vlsi.gradle-extensions'
ext['reactor-bom.version'] = '2022.0.7-SNAPSHOT'
ext['logback.version'] = '1.3.14'
ext['netty-bom.version'] = '4.1.106.Final'
ext['netty-boringssl.version'] = '2.0.62.Final'
ext['hdrhistogram.version'] = '2.1.12'
ext['mockito.version'] = '4.11.0'
ext['slf4j.version'] = '1.7.36'
ext['jmh.version'] = '1.36'
ext['junit.version'] = '5.9.3'
ext['micrometer.version'] = '1.11.0'
ext['micrometer-tracing.version'] = '1.1.1'
ext['assertj.version'] = '3.24.2'
ext['netflix.limits.version'] = '0.3.6'
ext['bouncycastle-bcpkix.version'] = '1.70'
ext['awaitility.version'] = '4.2.0'
group = "io.rsocket"
googleJavaFormat {
toolVersion = '1.6'
}
ext {
if (project.hasProperty('versionSuffix')) {
project.version += project.getProperty('versionSuffix')
}
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 60, "minutes"
}
dependencyManagement {
imports {
mavenBom "io.projectreactor:reactor-bom:${ext['reactor-bom.version']}"
mavenBom "io.netty:netty-bom:${ext['netty-bom.version']}"
mavenBom "org.junit:junit-bom:${ext['junit.version']}"
mavenBom "io.micrometer:micrometer-bom:${ext['micrometer.version']}"
mavenBom "io.micrometer:micrometer-tracing-bom:${ext['micrometer-tracing.version']}"
}
dependencies {
dependency "com.netflix.concurrency-limits:concurrency-limits-core:${ext['netflix.limits.version']}"
dependency "ch.qos.logback:logback-classic:${ext['logback.version']}"
dependency "io.netty:netty-tcnative-boringssl-static:${ext['netty-boringssl.version']}"
dependency "org.bouncycastle:bcpkix-jdk15on:${ext['bouncycastle-bcpkix.version']}"
dependency "org.assertj:assertj-core:${ext['assertj.version']}"
dependency "org.hdrhistogram:HdrHistogram:${ext['hdrhistogram.version']}"
dependency "org.slf4j:slf4j-api:${ext['slf4j.version']}"
dependency "org.awaitility:awaitility:${ext['awaitility.version']}"
dependencySet(group: 'org.mockito', version: ext['mockito.version']) {
entry 'mockito-junit-jupiter'
entry 'mockito-core'
}
dependencySet(group: 'org.openjdk.jmh', version: ext['jmh.version']) {
entry 'jmh-core'
entry 'jmh-generator-annprocess'
}
}
generatedPomCustomization {
enabled = false
}
}
repositories {
mavenCentral()
maven {
url 'https://repo.spring.io/milestone'
content {
includeGroup "io.micrometer"
includeGroup "io.projectreactor"
includeGroup "io.projectreactor.netty"
includeGroup "io.micrometer"
}
}
maven {
url 'https://repo.spring.io/snapshot'
content {
includeGroup "io.micrometer"
includeGroup "io.projectreactor"
includeGroup "io.projectreactor.netty"
}
}
if (version.endsWith('SNAPSHOT') || project.hasProperty('versionSuffix')) {
maven { url 'https://repo.spring.io/libs-snapshot' }
maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local' }
mavenLocal()
}
}
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
plugins.withType(JavaPlugin) {
compileJava {
sourceCompatibility = 1.8
// TODO: Cleanup warnings so no need to exclude
options.compilerArgs << '-Xlint:all,-overloads,-rawtypes,-unchecked'
}
javadoc {
def jdk = JavaVersion.current().majorVersion
def jdkJavadoc = "https://docs.oracle.com/javase/$jdk/docs/api/"
if (JavaVersion.current().isJava11Compatible()) {
jdkJavadoc = "https://docs.oracle.com/en/java/javase/$jdk/docs/api/"
}
options.with {
links jdkJavadoc
links 'https://projectreactor.io/docs/core/release/api/'
links 'https://netty.io/4.1/api/'
}
failOnError = false
}
tasks.named("javadoc").configure {
onlyIf { System.getenv('SKIP_RELEASE') != "true" }
}
test {
useJUnitPlatform()
testLogging {
events "PASSED", "FAILED"
showExceptions true
showCauses true
exceptionFormat "FULL"
stackTraceFilters "ENTRY_POINT"
maxGranularity 3
}
//show progress by displaying test classes, avoiding test suite timeouts
TestDescriptor last
afterTest { TestDescriptor td, TestResult tr ->
if (last != td.getParent()) {
last = td.getParent()
println last
}
}
if (isCiServer) {
def stdout = new LinkedList<TestOutputEvent>()
beforeTest { TestDescriptor td ->
stdout.clear()
}
onOutput { TestDescriptor td, TestOutputEvent toe ->
stdout.add(toe)
}
afterTest { TestDescriptor td, TestResult tr ->
if (tr.resultType == TestResult.ResultType.FAILURE && stdout.size() > 0) {
def stdOutput = stdout.collect {
it.getDestination().name() == "StdErr"
? "STD_ERR: ${it.getMessage()}"
: "STD_OUT: ${it.getMessage()}"
}
.join()
println "This is the console output of the failing test below:\n$stdOutput"
}
}
reports {
junitXml.outputPerTestCase = true
}
}
if (JavaVersion.current().isJava9Compatible()) {
println "Java 9+: lowering MaxGCPauseMillis to 20ms in ${project.name} ${name}"
println "Java 9+: enabling leak detection [ADVANCED]"
jvmArgs = ["-XX:MaxGCPauseMillis=20", "-Dio.netty.leakDetection.level=ADVANCED", "-Dio.netty.leakDetection.samplingInterval=32"]
}
systemProperty("java.awt.headless", "true")
systemProperty("testGroups", project.properties.get("testGroups"))
//allow re-run of failed tests only without special test tasks failing
// because the filter is too restrictive
filter.setFailOnNoMatchingTests(false)
//display intermediate results for special test tasks
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
println('\n' + "${desc} Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)")
}
}
}
}
plugins.withType(JavaLibraryPlugin) {
task sourcesJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier 'javadoc'
from javadoc.destinationDir
}
plugins.withType(MavenPublishPlugin) {
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
}
}
}
apply from: "${rootDir}/gradle/publications.gradle"
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
description = 'RSocket: Stream Oriented Messaging Passing with Reactive Stream Semantics.'
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/snapshot' }
mavenLocal()
}
configurations {
adoc
}
dependencies {
adoc "io.micrometer:micrometer-docs-generator-spans:1.0.0-SNAPSHOT"
adoc "io.micrometer:micrometer-docs-generator-metrics:1.0.0-SNAPSHOT"
}
task generateObservabilityDocs(dependsOn: ["generateObservabilityMetricsDocs", "generateObservabilitySpansDocs"]) {
}
task generateObservabilityMetricsDocs(type: JavaExec) {
mainClass = "io.micrometer.docs.metrics.DocsFromSources"
classpath configurations.adoc
args project.rootDir.getAbsolutePath(), ".*", project.rootProject.buildDir.getAbsolutePath()
}
task generateObservabilitySpansDocs(type: JavaExec) {
mainClass = "io.micrometer.docs.spans.DocsFromSources"
classpath configurations.adoc
args project.rootDir.getAbsolutePath(), ".*", project.rootProject.buildDir.getAbsolutePath()
}