/
build.gradle
123 lines (106 loc) · 4.02 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
import me.champeau.gradle.japicmp.JapicmpTask
/*
* Copyright (c) 2020-2022 VMware, Inc. or its affiliates, All Rights Reserved.
*
* 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
*
* https://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.
*/
apply plugin: 'io.spring.javadoc'
apply plugin: 'me.champeau.gradle.japicmp'
apply plugin: 'de.undercouch.download'
apply plugin: 'biz.aQute.bnd.builder'
ext {
bndOptions = [
"Export-Package" : "reactor.netty.http.brave*;version=$osgiVersion;-noimport:=true",
"Import-Package" : "!javax.annotation,*",
"Bundle-Name" : "reactor-netty-http-brave",
"Bundle-SymbolicName" : "io.projectreactor.netty.reactor-netty-http-brave",
"Bundle-Version" : "$osgiVersion"
]
}
dependencies {
api project(':reactor-netty-http')
api "io.zipkin.brave:brave-instrumentation-http:$braveVersion"
// JSR-305 annotations
compileOnly "com.google.code.findbugs:jsr305:$jsr305Version"
// JSR-305 annotations
testCompileOnly "com.google.code.findbugs:jsr305:$jsr305Version"
testImplementation "io.zipkin.brave:brave-instrumentation-http-tests:$braveVersion"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:$junitVersion"
testRuntimeOnly "ch.qos.logback:logback-classic:$logbackVersion"
}
jar {
manifest {
attributes("Automatic-Module-Name": "reactor.netty.http.brave")
}
bnd(bndOptions)
}
task downloadBaseline(type: Download) {
onlyIf {
if (project.gradle.startParameter.isOffline()) {
println "Offline: skipping downloading of baseline and JAPICMP"
return false
}
else if ("$compatibleVersion" == "SKIP") {
println "SKIP: Instructed to skip the baseline comparison"
return false
}
else {
println "Will download and perform baseline comparison with ${compatibleVersion}"
return true
}
}
onlyIfNewer true
compress true
src "${repositories.mavenCentral().url}io/projectreactor/netty/reactor-netty-http-brave/$compatibleVersion/reactor-netty-http-brave-${compatibleVersion}.jar"
dest "${buildDir}/baselineLibs/reactor-netty-http-brave-${compatibleVersion}.jar"
}
def japicmpReport = tasks.register('japicmpReport') {
onlyIf {
japicmp.state.failure != null
}
doLast {
def reportFile = file("${project.buildDir}/reports/japi.txt")
if (reportFile.exists()) {
println "\n **********************************"
println " * /!\\ API compatibility failures *"
println " **********************************"
println "Japicmp report was filtered and interpreted to find the following incompatibilities:"
reportFile.eachLine {
if (it.contains("*") && (!it.contains("***") || it.contains("****")))
println "source incompatible change: $it"
else if (it.contains("!"))
println "binary incompatible change: $it"
}
}
else println "No incompatible change to report"
}
}
task japicmp(type: JapicmpTask) {
finalizedBy(japicmpReport)
onlyIf { "$compatibleVersion" != "SKIP" }
oldClasspath.from(files("${buildDir}/baselineLibs/reactor-netty-http-brave-${compatibleVersion}.jar"))
newClasspath.from(files(jar.archiveFile))
// these onlyXxx parameters result in a report that is slightly too noisy, but better than
// onlyBinaryIncompatibleModified = true which masks source-incompatible-only changes
onlyBinaryIncompatibleModified = false
onlyModified = true
failOnModification = true
failOnSourceIncompatibility = true
txtOutputFile = file("${project.buildDir}/reports/japi.txt")
ignoreMissingClasses = true
includeSynthetic = true
compatibilityChangeExcludes = [ "METHOD_NEW_DEFAULT" ]
}
tasks.japicmp.dependsOn(downloadBaseline)
tasks.check.dependsOn(japicmp)
description = "Brave instrumentation for Reactor Netty HTTP"