Skip to content

Commit 8eabd73

Browse files
authored
Upgrade to Gradle 9.4.0 (#571)
Signed-off-by: Violeta Georgieva <696661+violetagg@users.noreply.github.com>
1 parent 0528733 commit 8eabd73

13 files changed

Lines changed: 296 additions & 193 deletions

File tree

.github/dependabot.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,13 @@ updates:
1616
- dependency-name: io.reactivex.rxjava2:rxjava
1717
versions:
1818
- "> 2.2.18, < 2.3"
19-
- dependency-name: me.champeau.gradle.jmh
20-
versions:
21-
- ">= 0.5.a, < 0.6"
2219
- dependency-name: org.junit.platform:junit-platform-launcher
2320
versions:
2421
- "> 1.0.0"
25-
- dependency-name: io.projectreactor.tools:blockhound
26-
versions:
27-
- 1.0.5.RELEASE
28-
- dependency-name: net.bytebuddy:byte-buddy-agent
29-
versions:
30-
- 1.10.20
31-
- dependency-name: net.bytebuddy:byte-buddy
32-
versions:
33-
- 1.10.20
3422
# Versions > 5 require JDK17+
3523
- dependency-name: org.junit.jupiter:*
3624
versions:
3725
- "[6.a, 7]"
38-
- dependency-name: gradle-wrapper
39-
versions:
40-
- "[7.6.a, 10]"
4126
rebase-strategy: disabled
4227
- package-ecosystem: github-actions
4328
directory: "/"

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ jobs:
1010

1111
steps:
1212
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
13-
- name: Set up JDK
13+
- name: Set up JDK 13
1414
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
1515
with:
1616
java-version: '13'
1717
distribution: 'adopt'
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
20+
with:
21+
java-version: '17'
22+
distribution: 'temurin'
1823
- name: Run tests and javadoc
1924
run: ./gradlew check javadoc

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up JDK
1616
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
1717
with:
18-
java-version: '8'
18+
java-version: '17'
1919
distribution: 'temurin'
2020
- name: Publish Release
2121
if: endsWith(github.event.release.tag_name, '.RELEASE')

.github/workflows/snapshot.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ jobs:
1212
runs-on: ubuntu-22.04
1313
steps:
1414
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
15-
- name: Set up JDK
15+
- name: Set up JDK 13
1616
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
1717
with:
1818
java-version: '13' # Modern JVM is needed for Java 10+ specific tests
1919
distribution: 'adopt'
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
22+
with:
23+
java-version: '17'
24+
distribution: 'temurin'
2025
- name: Run tests and javadoc
2126
run: ./gradlew check javadoc
2227
publishSnapshot:
@@ -35,7 +40,7 @@ jobs:
3540
- name: Set up JDK
3641
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
3742
with:
38-
java-version: '8'
43+
java-version: '17'
3944
distribution: 'temurin'
4045
- name: Publish Snapshot
4146
run: ./gradlew --no-daemon -Pversion=$BLOCKHOUND_VERSION publish

agent/build.gradle

Lines changed: 48 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
plugins {
2-
id 'com.github.johnrengelman.shadow' version '7.1.2'
2+
id 'com.gradleup.shadow' version '9.4.0'
33
id "java"
44
id "maven-publish"
55
id "signing"
6-
id "org.unbroken-dome.test-sets" version "4.0.0"
76
id 'me.champeau.gradle.japicmp' version '0.4.6' apply false
8-
id 'de.undercouch.download' version '5.7.0' apply false
7+
id 'de.undercouch.download' version '5.7.0' apply false
98
}
109

1110
import me.champeau.gradle.japicmp.JapicmpTask
@@ -15,14 +14,35 @@ apply plugin: 'de.undercouch.download'
1514
description = "BlockHound Java Agent"
1615
ext.detailedDescription = "Java agent to detect blocking calls from non-blocking threads."
1716

18-
testSets {
17+
sourceSets {
1918
jarFileTest
2019
}
2120

22-
sourceCompatibility = targetCompatibility = 8
21+
configurations {
22+
jarFileTestImplementation.extendsFrom(testImplementation)
23+
jarFileTestRuntimeOnly.extendsFrom(testRuntimeOnly)
24+
}
25+
26+
task jarFileTest(type: Test) {
27+
testClassesDirs = sourceSets.jarFileTest.output.classesDirs
28+
classpath = sourceSets.jarFileTest.runtimeClasspath
29+
}
30+
31+
java {
32+
sourceCompatibility = JavaVersion.VERSION_1_8
33+
targetCompatibility = JavaVersion.VERSION_1_8
34+
}
35+
36+
compileJava {
37+
options.release = 8
38+
}
39+
40+
jar {
41+
archiveClassifier.set('original')
42+
}
2343

2444
shadowJar {
25-
classifier = null
45+
archiveClassifier.set('')
2646

2747
from("${rootDir}/docs/src/docs/dist") {
2848
include "LICENSE"
@@ -46,18 +66,29 @@ shadowJar {
4666

4767
// TODO discuss with ByteBuddy folks how to shade it
4868
exclude 'win32-x86*/**'
69+
70+
enableAutoRelocation = true
71+
relocationPrefix = "reactor.blockhound.shaded"
4972
}
5073

5174
project.tasks.build.dependsOn(shadowJar)
5275

53-
task relocateShadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation) {
54-
target = tasks.shadowJar
55-
prefix = "reactor.blockhound.shaded"
76+
configurations {
77+
apiElements {
78+
outgoing {
79+
artifacts.clear()
80+
artifact(shadowJar)
81+
}
82+
}
83+
runtimeElements {
84+
outgoing {
85+
artifacts.clear()
86+
artifact(shadowJar)
87+
}
88+
}
5689
}
5790

58-
tasks.shadowJar.dependsOn tasks.relocateShadowJar
59-
60-
project.tasks.jarFileTest.configure {
91+
jarFileTest {
6192
systemProperty("jarFile", shadowJar.outputs.files.singleFile)
6293
dependsOn(shadowJar)
6394
}
@@ -110,7 +141,7 @@ publishing {
110141
artifact sourcesJar
111142
artifact javadocJar
112143

113-
artifactId 'blockhound'
144+
artifactId = 'blockhound'
114145
}
115146
}
116147
}
@@ -134,15 +165,15 @@ task downloadBaseline(type: Download) {
134165
onlyIfNewer true
135166
compress true
136167
src "${repositories.mavenCentral().url}io/projectreactor/tools/blockhound/$compatibleVersion/blockhound-${compatibleVersion}.jar"
137-
dest "${buildDir}/baselineLibs/blockhound-${compatibleVersion}.jar"
168+
dest layout.buildDirectory.file("baselineLibs/blockhound-${compatibleVersion}.jar").get().asFile
138169
}
139170

140171
def japicmpReport = tasks.register('japicmpReport') {
141172
onlyIf {
142173
japicmp.state.failure != null
143174
}
144175
doLast {
145-
def reportFile = file("${project.buildDir}/reports/japi.txt")
176+
def reportFile = layout.buildDirectory.file("reports/japi.txt").get().asFile
146177
if (reportFile.exists()) {
147178
println "\n **********************************"
148179
println " * /!\\ API compatibility failures *"
@@ -164,15 +195,15 @@ task japicmp(type: JapicmpTask) {
164195
dependsOn(shadowJar)
165196
onlyIf { "$compatibleVersion" != "SKIP" }
166197

167-
oldClasspath.from(files("${buildDir}/baselineLibs/blockhound-${compatibleVersion}.jar"))
198+
oldClasspath.from(files(layout.buildDirectory.file("baselineLibs/blockhound-${compatibleVersion}.jar").get().asFile))
168199
newClasspath.from(files(jar.archiveFile))
169200
// these onlyXxx parameters result in a report that is slightly too noisy, but better than
170201
// onlyBinaryIncompatibleModified = true which masks source-incompatible-only changes
171202
onlyBinaryIncompatibleModified = false
172203
onlyModified = true
173204
failOnModification = true
174205
failOnSourceIncompatibility = true
175-
txtOutputFile = file("${project.buildDir}/reports/japi.txt")
206+
txtOutputFile = layout.buildDirectory.file("reports/japi.txt").get().asFile
176207
ignoreMissingClasses = true
177208
includeSynthetic = true
178209

benchmarks/build.gradle

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
plugins {
22
id "java"
3-
id "me.champeau.gradle.jmh" version "0.5.3"
3+
id "me.champeau.jmh" version "0.7.3"
44
}
55

6-
sourceCompatibility = targetCompatibility = 8
6+
java {
7+
sourceCompatibility = JavaVersion.VERSION_1_8
8+
targetCompatibility = JavaVersion.VERSION_1_8
9+
}
710

811
repositories {
9-
maven { url 'https://repo.spring.io/libs-milestone' }
12+
maven { url = 'https://repo.spring.io/libs-milestone' }
1013
}
1114

1215
jmh {
13-
jmhVersion = '1.23'
14-
duplicateClassesStrategy DuplicatesStrategy.INCLUDE
16+
jmhVersion = '1.37'
17+
duplicateClassesStrategy = DuplicatesStrategy.INCLUDE
1518
failOnError = true
1619

1720
def outputType = "baseline" == project.findProperty("jmhTarget") ? "jmhBaseline" : "jmh"
1821
resultFormat = "text"
19-
resultsFile = project.file("${project.buildDir}/reports/${outputType}/result.${resultFormat}")
22+
resultsFile = layout.buildDirectory.file("reports/${outputType}/result.text").get().asFile
2023
}
2124

2225
dependencies {
@@ -25,8 +28,6 @@ dependencies {
2528
jmh "io.projectreactor.tools:blockhound:${compatibleVersion}"
2629
break
2730
default:
28-
jmh project(path: ":agent", configuration: 'shadow')
31+
jmh project(":agent")
2932
}
30-
31-
jmh "org.openjdk.jmh:jmh-generator-annprocess:${jmh.jmhVersion}"
3233
}

build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ subprojects {
77
mavenCentral()
88
}
99

10-
tasks.withType(Test).all {
11-
def javaMajorVersion = System.getProperty("java.version").split("\\.", 2)[0].toInteger()
12-
if (javaMajorVersion >= 13) {
13-
jvmArgs += [
14-
"-XX:+AllowRedefinitionToAddDeleteMethods"
15-
]
10+
tasks.withType(Test).configureEach {
11+
javaLauncher = javaToolchains.launcherFor {
12+
languageVersion = JavaLanguageVersion.of(13)
1613
}
14+
jvmArgs += [
15+
"-XX:+AllowRedefinitionToAddDeleteMethods"
16+
]
1717
}
1818

1919

@@ -22,7 +22,7 @@ subprojects {
2222
//This works because the version is only defined by CI scripts, and only the release one should use .RELEASE suffix
2323
def shouldSign = version.toString().endsWith(".RELEASE")
2424
project.signing {
25-
required { shouldSign }
25+
required = { shouldSign }
2626

2727
//skip the configuration entirely if !shouldSign. the task shouldn't even be available
2828
if (shouldSign) {
@@ -41,7 +41,7 @@ subprojects {
4141
project.publishing {
4242
repositories {
4343
maven {
44-
url System.getenv('GRADLE_PUBLISH_REPO_URL')
44+
url = System.getenv('GRADLE_PUBLISH_REPO_URL')
4545
credentials {
4646
username = System.getenv('GRADLE_PUBLISH_MAVEN_USER')
4747
password = System.getenv('GRADLE_PUBLISH_MAVEN_PASSWORD')
@@ -51,7 +51,7 @@ subprojects {
5151
}
5252
}
5353

54-
tasks.withType(GenerateModuleMetadata) {
54+
tasks.withType(GenerateModuleMetadata).configureEach {
5555
enabled = false
5656
}
5757
}

example/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ plugins {
33
}
44

55
repositories {
6-
maven { url 'https://repo.spring.io/libs-milestone' }
6+
maven { url = 'https://repo.spring.io/libs-milestone' }
7+
}
8+
9+
compileTestJava {
10+
options.release = 10
711
}
812

913
test {
1014
dependsOn(tasks.getByPath(":agent:shadowJar"))
1115

12-
sourceCompatibility = targetCompatibility = 10
13-
1416
// Creates a JVM per test because the agent can be installed only once,
1517
// and we test different installations.
1618
// This is not required in normal testing scenarios
1719
forkEvery = 1
1820
maxParallelForks = 1
1921
jvmArgs += [
2022
"-Xverify:all",
21-
JavaVersion.current().isJava9Compatible()
22-
? "-Xlog:redefine+class*=warning"
23-
: "-XX:TraceRedefineClasses=2"
23+
"-Xlog:redefine+class*=warning"
2424
]
2525
}
2626

@@ -41,7 +41,7 @@ task testReactor3_3_x(type: Test) {
4141
check.dependsOn(testReactor3_3_x)
4242

4343
dependencies {
44-
testImplementation project(path: ":agent", configuration: 'shadow')
44+
testImplementation project(":agent")
4545
testImplementation 'io.projectreactor:reactor-core:3.2.5.RELEASE'
4646
testImplementation 'io.reactivex.rxjava2:rxjava:2.2.18'
4747

gradle/wrapper/gradle-wrapper.jar

-10 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)