Skip to content

Commit 75137de

Browse files
committed
Upgrade Gradle and dependencies
1 parent eb39a4d commit 75137de

3 files changed

Lines changed: 41 additions & 12 deletions

File tree

build.gradle.kts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import com.github.spotbugs.snom.Confidence
22
import com.github.spotbugs.snom.Effort
33
import java.text.SimpleDateFormat
4+
import java.time.format.DateTimeFormatter
5+
import java.time.Instant
6+
import java.time.ZoneOffset
47
import java.util.Date
58
import java.util.Locale
69

@@ -23,7 +26,12 @@ val baseVersion = "2.0.1"
2326
val isSnapshot = true
2427

2528
val isCIServer = System.getenv("CTHING_CI") != null
26-
val buildNumber = if (isCIServer) System.currentTimeMillis().toString() else "0"
29+
val now = System.currentTimeMillis()
30+
val buildNumber = if (isCIServer) now.toString() else "0"
31+
val buildDate: String = Instant.ofEpochMilli(now)
32+
.atOffset(ZoneOffset.UTC)
33+
.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'"))
34+
2735
version = if (isSnapshot) "$baseVersion-$buildNumber" else baseVersion
2836
group = "org.cthing"
2937
description = "A version object for C Thing Software projects."
@@ -38,6 +46,17 @@ java {
3846
//
3947
// This project is a dependency of all C Thing Software projects. Therefore, to avoid circular
4048
// dependencies, it should not depend on any C Thing Software project.
49+
configurations.all {
50+
resolutionStrategy {
51+
eachDependency {
52+
val prohibitedGroups = listOf("org.cthing", "com.cthing")
53+
if (requested.group in prohibitedGroups) {
54+
throw GradleException("A dependency on '${requested.group}:${requested.name}' is prohibited.")
55+
}
56+
}
57+
}
58+
}
59+
4160
dependencies {
4261
api(libs.jspecify)
4362

@@ -181,6 +200,10 @@ publishing {
181200
name = project.name
182201
description = project.description
183202
url = "https://github.com/cthing/${project.name}"
203+
organization {
204+
name = "C Thing Software"
205+
url = "https://www.cthing.com"
206+
}
184207
licenses {
185208
license {
186209
name = "Apache-2.0"
@@ -205,6 +228,12 @@ publishing {
205228
system = "GitHub Issues"
206229
url = "https://github.com/cthing/${project.name}/issues"
207230
}
231+
ciManagement {
232+
url = "https://github.com/cthing/${project.name}/actions"
233+
system = "GitHub Actions"
234+
}
235+
properties.putAll(mapOf("cthing.build.date" to buildDate,
236+
"cthing.build.number" to buildNumber))
208237
}
209238
}
210239
}

gradle/libs.versions.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
[versions]
22
java = "17"
3-
checkstyle = "10.20.2"
3+
checkstyle = "10.21.2"
44
jacoco = "0.8.12"
5-
junit = "5.11.3"
6-
spotbugs = "4.8.6"
5+
junit = "5.11.4"
6+
spotbugs = "4.9.0"
77

88
[plugins]
9-
dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = "2.6.0" }
10-
spotbugs = { id = "com.github.spotbugs", version = "6.0.26" }
11-
versions = { id = "com.github.ben-manes.versions", version = "0.51.0" }
9+
dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = "2.8.0" }
10+
spotbugs = { id = "com.github.spotbugs", version = "6.1.3" }
11+
versions = { id = "com.github.ben-manes.versions", version = "0.52.0" }
1212

1313
[libraries]
14-
assertJ = "org.assertj:assertj-core:3.26.3"
15-
equalsVerifier = "nl.jqno.equalsverifier:equalsverifier:3.17.5"
14+
assertJ = "org.assertj:assertj-core:3.27.3"
15+
equalsVerifier = "nl.jqno.equalsverifier:equalsverifier:3.19"
1616
jspecify = "org.jspecify:jspecify:1.0.0"
1717
junitApi = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
1818
junitEngine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }
19-
junitLauncher = "org.junit.platform:junit-platform-launcher:1.11.3"
20-
spotbugsContrib = "com.mebigfatguy.sb-contrib:sb-contrib:7.6.8"
19+
junitLauncher = "org.junit.platform:junit-platform-launcher:1.11.4"
20+
spotbugsContrib = "com.mebigfatguy.sb-contrib:sb-contrib:7.6.9"
2121
systemLambda = "com.github.stefanbirkner:system-lambda:1.2.1"

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)