Skip to content

Commit 4615fe0

Browse files
committed
Update Gradle to 8.11.1
1 parent e8cad47 commit 4615fe0

15 files changed

+399
-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: 54 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.sgtsilvio.gradle.maven-central-publishing")
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.license)
9+
alias(libs.plugins.maven.central.publishing)
10+
alias(libs.plugins.metadata)
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("silvio.giebl@hivemq.com")
4037
}
4138
}
@@ -48,42 +45,50 @@ 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+
allprojects {
69+
repositories {
70+
mavenCentral()
71+
}
72+
}
73+
6874
dependencies {
69-
api("io.reactivex.rxjava2:rxjava:${property("rxjava.version")}")
70-
api("org.reactivestreams:reactive-streams:${property("reactive-streams.version")}")
75+
api(libs.rxjava)
76+
api(libs.reactive.streams)
7177

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")}")
78+
implementation(libs.netty.buffer)
79+
implementation(libs.netty.codec)
80+
implementation(libs.netty.common)
81+
implementation(libs.netty.handler)
82+
implementation(libs.netty.transport)
83+
implementation(libs.jctools)
84+
implementation(libs.jetbrains.annotations)
85+
implementation(libs.dagger)
8086

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

83-
annotationProcessor("com.google.dagger:dagger-compiler:${property("dagger.version")}")
89+
annotationProcessor(libs.dagger.compiler)
8490
}
8591

86-
8792
/* ******************** optional dependencies ******************** */
8893

8994
for (feature in listOf("websocket", "proxy", "epoll")) {
@@ -93,20 +98,19 @@ for (feature in listOf("websocket", "proxy", "epoll")) {
9398
}
9499

95100
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")
101+
"websocketImplementation"(libs.netty.codec.http)
102+
"proxyImplementation"(libs.netty.handler.proxy)
103+
"epollImplementation"(variantOf(libs.netty.transport.native.epoll) { classifier("linux-x86_64") })
99104
}
100105

101-
102106
/* ******************** test ******************** */
103107

104108
allprojects {
105109
plugins.withId("java") {
106110
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")}")
111+
testImplementation(libs.junit.jupiter.api)
112+
testImplementation(libs.junit.jupiter.params)
113+
testRuntimeOnly(libs.junit.jupiter.engine)
110114
}
111115

112116
tasks.test {
@@ -119,13 +123,13 @@ allprojects {
119123
}
120124

121125
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")}")
126+
testImplementation(libs.equalsverifier)
127+
testImplementation(libs.mockito)
128+
testImplementation(libs.guava)
129+
testImplementation(libs.bouncycastle.pkix)
130+
testImplementation(libs.bouncycastle.prov)
131+
testImplementation(libs.paho.client)
132+
testRuntimeOnly(libs.slf4j.simple)
129133
}
130134

131135
/* ******************** integration Tests ******************** */
@@ -143,15 +147,9 @@ val integrationTestRuntimeOnly: Configuration by configurations.getting {
143147
}
144148

145149
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-
})
150+
integrationTestImplementation(libs.hivemq.testcontainer.junit5)
151+
integrationTestImplementation(libs.hivemq.extension.sdk)
152+
integrationTestImplementation(libs.awaitility)
155153
}
156154

157155
val integrationTest by tasks.registering(Test::class) {
@@ -161,9 +159,6 @@ val integrationTest by tasks.registering(Test::class) {
161159
testClassesDirs = sourceSets["integrationTest"].output.classesDirs
162160
classpath = sourceSets["integrationTest"].runtimeClasspath
163161
shouldRunAfter(tasks.test)
164-
javaLauncher.set(javaToolchains.launcherFor {
165-
languageVersion.set(JavaLanguageVersion.of(11))
166-
})
167162
}
168163

169164
tasks.check { dependsOn(integrationTest) }
@@ -172,30 +167,25 @@ tasks.check { dependsOn(integrationTest) }
172167

173168
allprojects {
174169
plugins.withId("java-library") {
175-
176170
plugins.apply("biz.aQute.bnd.builder")
177-
178171
tasks.jar {
179-
withConvention(aQute.bnd.gradle.BundleTaskConvention::class) {
172+
bundle {
180173
bnd("-consumer-policy: \${range;[==,=+)}", "-removeheaders: Private-Package")
181174
}
182175
}
183-
184176
java {
185177
withJavadocJar()
186178
withSourcesJar()
187179
}
188-
189180
plugins.apply("com.github.sgtsilvio.gradle.javadoc-links")
190-
191181
tasks.javadoc {
192182
exclude("**/internal/**")
193183
}
194184
}
195185
}
196186

197187
tasks.jar {
198-
withConvention(aQute.bnd.gradle.BundleTaskConvention::class) {
188+
bundle {
199189
bnd("Export-Package: " +
200190
"com.hivemq.client.annotations.*," +
201191
"com.hivemq.client.mqtt.*," +
@@ -225,8 +215,6 @@ tasks.shadowJar {
225215
relocate("dagger", "${shadePrefix}dagger")
226216
exclude("META-INF/com.google.dagger_dagger.version")
227217
relocate("javax.inject", "${shadePrefix}javax.inject")
228-
229-
minimize()
230218
}
231219

232220
val javaComponent = components["java"] as AdhocComponentWithVariants
@@ -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
@@ -314,7 +295,6 @@ allprojects {
314295

315296
allprojects {
316297
plugins.apply("com.github.hierynomus.license")
317-
318298
license {
319299
header = rootDir.resolve("HEADER")
320300
mapping("java", "SLASHSTAR_STYLE")
@@ -323,19 +303,16 @@ allprojects {
323303

324304
allprojects {
325305
plugins.withId("java") {
326-
327306
plugins.apply("pmd")
328-
329307
pmd {
330-
toolVersion = "5.8.1"
308+
toolVersion = libs.versions.pmd.get()
331309
incrementalAnalysis.set(false)
332310
}
333311
}
334312
}
335313

336314
apply("$rootDir/gradle/japicc.gradle.kts")
337315

338-
339316
/* ******************** build cache ******************** */
340317

341318
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.maven-central-publish.version=0.4.1
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)