Skip to content

Commit 5a77d40

Browse files
committed
Update Gradle to 8.11.1
1 parent 0a739a9 commit 5a77d40

15 files changed

+401
-358
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
distribution: temurin
1919
java-version: |
2020
8
21-
11
21+
21
2222
- name: Check
2323
run: ./gradlew check javadoc

.github/workflows/publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ jobs:
1515
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4
1616
with:
1717
distribution: temurin
18-
java-version: 8
18+
java-version: |
19+
8
20+
21
1921
- name: Publish to Maven Central
2022
env:
2123
ORG_GRADLE_PROJECT_signKey: ${{ secrets.SIGN_KEY }}

build.gradle.kts

Lines changed: 52 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
plugins {
22
id("java-library")
3-
id("com.github.johnrengelman.shadow")
4-
id("biz.aQute.bnd.builder")
53
id("maven-publish")
6-
id("io.github.gradle-nexus.publish-plugin")
74
id("signing")
8-
id("com.github.hierynomus.license")
95
id("pmd")
10-
id("com.github.sgtsilvio.gradle.utf8")
11-
id("com.github.sgtsilvio.gradle.metadata")
12-
id("com.github.sgtsilvio.gradle.javadoc-links")
6+
alias(libs.plugins.bnd)
7+
alias(libs.plugins.javadoc.links)
8+
alias(libs.plugins.metadata)
9+
alias(libs.plugins.nexus.publish)
10+
alias(libs.plugins.license)
11+
alias(libs.plugins.shadow)
12+
alias(libs.plugins.utf8)
1313
}
1414

15-
1615
/* ******************** metadata ******************** */
1716

1817
allprojects {
@@ -21,7 +20,6 @@ allprojects {
2120
"Java client library with different API flavours and backpressure support"
2221

2322
plugins.apply("com.github.sgtsilvio.gradle.metadata")
24-
2523
metadata {
2624
moduleName.set("com.hivemq.client.mqtt")
2725
readableName.set("HiveMQ MQTT Client")
@@ -33,9 +31,8 @@ allprojects {
3331
apache2()
3432
}
3533
developers {
36-
developer {
37-
id.set("SgtSilvio")
38-
name.set("Silvio Giebl")
34+
register("SgtSilvio") {
35+
fullName.set("Silvio Giebl")
3936
email.set("[email protected]")
4037
}
4138
}
@@ -48,42 +45,48 @@ allprojects {
4845
}
4946
}
5047

51-
5248
/* ******************** java ******************** */
5349

5450
allprojects {
5551
plugins.withId("java") {
5652
java {
57-
sourceCompatibility = JavaVersion.VERSION_1_8
58-
targetCompatibility = JavaVersion.VERSION_1_8
53+
toolchain {
54+
languageVersion = JavaLanguageVersion.of(21)
55+
}
56+
tasks.compileJava {
57+
javaCompiler = javaToolchains.compilerFor {
58+
languageVersion = JavaLanguageVersion.of(8)
59+
}
60+
}
5961
}
60-
6162
plugins.apply("com.github.sgtsilvio.gradle.utf8")
6263
}
6364
}
6465

65-
6666
/* ******************** dependencies ******************** */
6767

68+
repositories {
69+
mavenCentral()
70+
}
71+
6872
dependencies {
69-
api("io.reactivex.rxjava2:rxjava:${property("rxjava.version")}")
70-
api("org.reactivestreams:reactive-streams:${property("reactive-streams.version")}")
73+
api(libs.rxjava)
74+
api(libs.reactive.streams)
7175

72-
implementation("io.netty:netty-buffer:${property("netty.version")}")
73-
implementation("io.netty:netty-codec:${property("netty.version")}")
74-
implementation("io.netty:netty-common:${property("netty.version")}")
75-
implementation("io.netty:netty-handler:${property("netty.version")}")
76-
implementation("io.netty:netty-transport:${property("netty.version")}")
77-
implementation("org.jctools:jctools-core:${property("jctools.version")}")
78-
implementation("org.jetbrains:annotations:${property("annotations.version")}")
79-
implementation("com.google.dagger:dagger:${property("dagger.version")}")
76+
implementation(libs.netty.buffer)
77+
implementation(libs.netty.codec)
78+
implementation(libs.netty.common)
79+
implementation(libs.netty.handler)
80+
implementation(libs.netty.transport)
81+
implementation(libs.jctools)
82+
implementation(libs.jetbrains.annotations)
83+
implementation(libs.dagger)
8084

81-
compileOnly("org.slf4j:slf4j-api:${property("slf4j.version")}")
85+
compileOnly(libs.slf4j.api)
8286

83-
annotationProcessor("com.google.dagger:dagger-compiler:${property("dagger.version")}")
87+
annotationProcessor(libs.dagger.compiler)
8488
}
8589

86-
8790
/* ******************** optional dependencies ******************** */
8891

8992
for (feature in listOf("websocket", "proxy", "epoll")) {
@@ -93,20 +96,19 @@ for (feature in listOf("websocket", "proxy", "epoll")) {
9396
}
9497

9598
dependencies {
96-
"websocketImplementation"("io.netty:netty-codec-http:${property("netty.version")}")
97-
"proxyImplementation"("io.netty:netty-handler-proxy:${property("netty.version")}")
98-
"epollImplementation"("io.netty:netty-transport-native-epoll:${property("netty.version")}:linux-x86_64")
99+
"websocketImplementation"(libs.netty.codec.http)
100+
"proxyImplementation"(libs.netty.handler.proxy)
101+
"epollImplementation"(variantOf(libs.netty.transport.native.epoll) { classifier("linux-x86_64") })
99102
}
100103

101-
102104
/* ******************** test ******************** */
103105

104106
allprojects {
105107
plugins.withId("java") {
106108
dependencies {
107-
testImplementation("org.junit.jupiter:junit-jupiter-api:${property("junit-jupiter.version")}")
108-
testImplementation("org.junit.jupiter:junit-jupiter-params:${property("junit-jupiter.version")}")
109-
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${property("junit-jupiter.version")}")
109+
testImplementation(libs.junit.jupiter.api)
110+
testImplementation(libs.junit.jupiter.params)
111+
testRuntimeOnly(libs.junit.jupiter.engine)
110112
}
111113

112114
tasks.test {
@@ -119,13 +121,13 @@ allprojects {
119121
}
120122

121123
dependencies {
122-
testImplementation("nl.jqno.equalsverifier:equalsverifier:${property("equalsverifier.version")}")
123-
testImplementation("org.mockito:mockito-core:${property("mockito.version")}")
124-
testImplementation("com.google.guava:guava:${property("guava.version")}")
125-
testImplementation("org.bouncycastle:bcprov-jdk15on:${property("bouncycastle.version")}")
126-
testImplementation("org.bouncycastle:bcpkix-jdk15on:${property("bouncycastle.version")}")
127-
testImplementation("org.eclipse.paho:org.eclipse.paho.client.mqttv3:${property("paho.version")}")
128-
testRuntimeOnly("org.slf4j:slf4j-simple:${property("slf4j.version")}")
124+
testImplementation(libs.equalsverifier)
125+
testImplementation(libs.mockito)
126+
testImplementation(libs.guava)
127+
testImplementation(libs.bouncycastle.pkix)
128+
testImplementation(libs.bouncycastle.prov)
129+
testImplementation(libs.paho.client)
130+
testRuntimeOnly(libs.slf4j.simple)
129131
}
130132

131133
/* ******************** integration Tests ******************** */
@@ -143,15 +145,9 @@ val integrationTestRuntimeOnly: Configuration by configurations.getting {
143145
}
144146

145147
dependencies {
146-
integrationTestImplementation("com.hivemq:hivemq-testcontainer-junit5:${property("hivemq-testcontainer.version")}")
147-
integrationTestImplementation("com.hivemq:hivemq-extension-sdk:${property("hivemq-extension-sdk.version")}")
148-
integrationTestImplementation("org.awaitility:awaitility:${property("awaitility.version")}")
149-
}
150-
151-
tasks.named<JavaCompile>("compileIntegrationTestJava") {
152-
javaCompiler.set(javaToolchains.compilerFor {
153-
languageVersion.set(JavaLanguageVersion.of(11))
154-
})
148+
integrationTestImplementation(libs.hivemq.testcontainer.junit5)
149+
integrationTestImplementation(libs.hivemq.extension.sdk)
150+
integrationTestImplementation(libs.awaitility)
155151
}
156152

157153
val integrationTest by tasks.registering(Test::class) {
@@ -161,9 +157,6 @@ val integrationTest by tasks.registering(Test::class) {
161157
testClassesDirs = sourceSets["integrationTest"].output.classesDirs
162158
classpath = sourceSets["integrationTest"].runtimeClasspath
163159
shouldRunAfter(tasks.test)
164-
javaLauncher.set(javaToolchains.launcherFor {
165-
languageVersion.set(JavaLanguageVersion.of(11))
166-
})
167160
}
168161

169162
tasks.check { dependsOn(integrationTest) }
@@ -172,30 +165,25 @@ tasks.check { dependsOn(integrationTest) }
172165

173166
allprojects {
174167
plugins.withId("java-library") {
175-
176168
plugins.apply("biz.aQute.bnd.builder")
177-
178169
tasks.jar {
179-
withConvention(aQute.bnd.gradle.BundleTaskConvention::class) {
170+
bundle {
180171
bnd("-consumer-policy: \${range;[==,=+)}", "-removeheaders: Private-Package")
181172
}
182173
}
183-
184174
java {
185175
withJavadocJar()
186176
withSourcesJar()
187177
}
188-
189178
plugins.apply("com.github.sgtsilvio.gradle.javadoc-links")
190-
191179
tasks.javadoc {
192180
exclude("**/internal/**")
193181
}
194182
}
195183
}
196184

197185
tasks.jar {
198-
withConvention(aQute.bnd.gradle.BundleTaskConvention::class) {
186+
bundle {
199187
bnd("Export-Package: " +
200188
"com.hivemq.client.annotations.*," +
201189
"com.hivemq.client.mqtt.*," +
@@ -225,8 +213,6 @@ tasks.shadowJar {
225213
relocate("dagger", "${shadePrefix}dagger")
226214
exclude("META-INF/com.google.dagger_dagger.version")
227215
relocate("javax.inject", "${shadePrefix}javax.inject")
228-
229-
minimize()
230216
}
231217

232218
val javaComponent = components["java"] as AdhocComponentWithVariants
@@ -238,19 +224,14 @@ javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements
238224

239225
allprojects {
240226
plugins.withId("java-library") {
241-
242227
plugins.apply("maven-publish")
243-
244228
publishing.publications.register<MavenPublication>("base") {
245229
from(components["java"])
246230
suppressAllPomMetadataWarnings()
247231
}
248232
}
249-
250233
plugins.withId("java-platform") {
251-
252234
plugins.apply("maven-publish")
253-
254235
publishing.publications.register<MavenPublication>("base") {
255236
from(components["javaPlatform"])
256237
suppressAllPomMetadataWarnings()
@@ -296,9 +277,7 @@ allprojects {
296277

297278
allprojects {
298279
plugins.withId("maven-publish") {
299-
300280
plugins.apply("signing")
301-
302281
signing {
303282
val signKey: String? by project
304283
val signKeyPass: String? by project
@@ -320,7 +299,6 @@ nexusPublishing {
320299

321300
allprojects {
322301
plugins.apply("com.github.hierynomus.license")
323-
324302
license {
325303
header = rootDir.resolve("HEADER")
326304
mapping("java", "SLASHSTAR_STYLE")
@@ -329,19 +307,16 @@ allprojects {
329307

330308
allprojects {
331309
plugins.withId("java") {
332-
333310
plugins.apply("pmd")
334-
335311
pmd {
336-
toolVersion = "5.8.1"
312+
toolVersion = libs.versions.pmd.get()
337313
incrementalAnalysis.set(false)
338314
}
339315
}
340316
}
341317

342318
apply("$rootDir/gradle/japicc.gradle.kts")
343319

344-
345320
/* ******************** build cache ******************** */
346321

347322
allprojects {

epoll/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ plugins {
22
id("java-platform")
33
}
44

5-
65
/* ******************** metadata ******************** */
76

87
description = "Adds dependencies for the HiveMQ MQTT Client epoll module"
@@ -12,7 +11,6 @@ metadata {
1211
readableName.set("HiveMQ MQTT Client epoll module")
1312
}
1413

15-
1614
/* ******************** dependencies ******************** */
1715

1816
javaPlatform {

examples/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ plugins {
22
id("java")
33
}
44

5-
65
/* ******************** metadata ******************** */
76

87
description = "Examples using the HiveMQ MQTT Client"
@@ -12,7 +11,6 @@ metadata {
1211
readableName.set("HiveMQ MQTT Client examples")
1312
}
1413

15-
1614
/* ******************** dependencies ******************** */
1715

1816
dependencies {

gradle.properties

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,3 @@
11
version=1.3.7
22
prevVersion=1.3.6
3-
#
4-
# main dependencies
5-
#
6-
rxjava.version=2.2.21
7-
reactive-streams.version=1.0.4
8-
netty.version=4.1.122.Final
9-
jctools.version=2.1.2
10-
annotations.version=26.0.2
11-
dagger.version=2.27
12-
slf4j.version=1.7.36
13-
reactor.version=3.7.6
14-
reactor-adapter.version=3.3.3.RELEASE
15-
#
16-
# test dependencies
17-
#
18-
junit-jupiter.version=5.5.2
19-
equalsverifier.version=3.19.4
20-
mockito.version=2.28.2
21-
guava.version=24.1.1-jre
22-
bouncycastle.version=1.70
23-
paho.version=1.2.5
24-
#
25-
# integration test dependencies
26-
#
27-
hivemq-testcontainer.version=2.0.0
28-
hivemq-extension-sdk.version=4.7.2
29-
awaitility.version=4.3.0
30-
#
31-
# plugins
32-
#
33-
plugin.shadow.version=6.1.0
34-
plugin.bnd.version=5.3.0
35-
plugin.nexus-publish.version=1.3.0
36-
plugin.license.version=0.15.0
37-
plugin.utf8.version=0.1.0
38-
plugin.metadata.version=0.2.0
39-
plugin.javadoc-links.version=0.3.0
40-
#
41-
# options
42-
#
433
org.gradle.caching=true

0 commit comments

Comments
 (0)