Skip to content

Commit f79ee6d

Browse files
committed
Update Gradle to 8.11.1
1 parent 3a26e48 commit f79ee6d

13 files changed

+394
-354
lines changed

build.gradle.kts

Lines changed: 52 additions & 75 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
}
@@ -46,44 +43,50 @@ allprojects {
4643
issues()
4744
}
4845
}
49-
}
5046

47+
repositories {
48+
mavenCentral()
49+
}
50+
}
5151

5252
/* ******************** java ******************** */
5353

5454
allprojects {
5555
plugins.withId("java") {
5656
java {
57-
sourceCompatibility = JavaVersion.VERSION_1_8
58-
targetCompatibility = JavaVersion.VERSION_1_8
57+
toolchain {
58+
languageVersion = JavaLanguageVersion.of(21)
59+
}
60+
tasks.compileJava {
61+
javaCompiler = javaToolchains.compilerFor {
62+
languageVersion = JavaLanguageVersion.of(8)
63+
}
64+
}
5965
}
60-
6166
plugins.apply("com.github.sgtsilvio.gradle.utf8")
6267
}
6368
}
6469

65-
6670
/* ******************** dependencies ******************** */
6771

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.*," +
@@ -238,19 +226,14 @@ javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements
238226

239227
allprojects {
240228
plugins.withId("java-library") {
241-
242229
plugins.apply("maven-publish")
243-
244230
publishing.publications.register<MavenPublication>("base") {
245231
from(components["java"])
246232
suppressAllPomMetadataWarnings()
247233
}
248234
}
249-
250235
plugins.withId("java-platform") {
251-
252236
plugins.apply("maven-publish")
253-
254237
publishing.publications.register<MavenPublication>("base") {
255238
from(components["javaPlatform"])
256239
suppressAllPomMetadataWarnings()
@@ -296,9 +279,7 @@ allprojects {
296279

297280
allprojects {
298281
plugins.withId("maven-publish") {
299-
300282
plugins.apply("signing")
301-
302283
signing {
303284
val signKey: String? by project
304285
val signKeyPass: String? by project
@@ -320,7 +301,6 @@ nexusPublishing {
320301

321302
allprojects {
322303
plugins.apply("com.github.hierynomus.license")
323-
324304
license {
325305
header = rootDir.resolve("HEADER")
326306
mapping("java", "SLASHSTAR_STYLE")
@@ -329,19 +309,16 @@ allprojects {
329309

330310
allprojects {
331311
plugins.withId("java") {
332-
333312
plugins.apply("pmd")
334-
335313
pmd {
336-
toolVersion = "5.8.1"
314+
toolVersion = libs.versions.pmd.get()
337315
incrementalAnalysis.set(false)
338316
}
339317
}
340318
}
341319

342320
apply("$rootDir/gradle/japicc.gradle.kts")
343321

344-
345322
/* ******************** build cache ******************** */
346323

347324
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: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,4 @@
11
version=1.3.6
22
prevVersion=1.3.5
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-
#
3+
434
org.gradle.caching=true

gradle/japicc.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ val japiccDownload = tasks.register("japiccDownload") {
3030
allprojects {
3131
plugins.withId("java-library") {
3232
plugins.withId("maven-publish") {
33-
3433
val japicc = tasks.register("japicc") {
3534
group = "verification"
3635
description = "Runs all binary and source incompatibility checks"
@@ -130,7 +129,6 @@ allprojects {
130129
}
131130

132131
fun addArtifact(publication: MavenPublication, artifact: MavenArtifact) {
133-
134132
val japiccDownloadArtifact = tasks.register("japiccDownload-${publication.artifactId}") {
135133
group = "japicc"
136134
description = "Downloads the previous version of ${publication.artifactId}"

0 commit comments

Comments
 (0)