From 7511242d36bd353aa95220f1a2a6797ef8089570 Mon Sep 17 00:00:00 2001 From: Baron Roberts Date: Fri, 7 Feb 2025 00:29:25 -0800 Subject: [PATCH] Upgrade Gradle and dependencies --- build.gradle.kts | 55 ++++++++++++++++++++++++ gradle/libs.versions.toml | 20 ++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 66 insertions(+), 11 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 7e9f0a4..4557ac3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -59,6 +59,17 @@ gradlePlugin { // // This project is a dependency of all C Thing Software projects. Therefore, to avoid circular // dependencies, the only C Thing Software project it should depend on is cthing-projectversion. +configurations.all { + resolutionStrategy { + eachDependency { + if (requested.group == "com.cthing" + || (requested.group == "org.cthing" && requested.name != "cthing-projectversion")) { + throw GradleException("A dependency on '${requested.group}:${requested.name}' is prohibited.") + } + } + } +} + dependencies { api(libs.cthingProjectVersion) @@ -200,6 +211,50 @@ tasks { } publishing { + publications { + maybeCreate("pluginMaven", MavenPublication::class.java).pom { + name = project.name + description = project.description + url = "https://github.com/cthing/${project.name}" + organization { + name = "C Thing Software" + url = "https://www.cthing.com" + } + licenses { + license { + name = "Apache-2.0" + url = "https://www.apache.org/licenses/LICENSE-2.0" + } + } + developers { + developer { + id = "baron" + name = "Baron Roberts" + email = "baron@cthing.com" + organization = "C Thing Software" + organizationUrl = "https://www.cthing.com" + } + } + scm { + connection = "scm:git:https://github.com/cthing/${project.name}.git" + developerConnection = "scm:git:git@github.com:cthing/${project.name}.git" + url = "https://github.com/cthing/${project.name}" + } + issueManagement { + system = "GitHub Issues" + url = "https://github.com/cthing/${project.name}/issues" + } + ciManagement { + url = "https://github.com/cthing/${project.name}/actions" + system = "GitHub Actions" + } + properties.putAll(mapOf("cthing.build.date" to (project.version as ProjectVersion).buildDate, + "cthing.build.number" to (project.version as ProjectVersion).buildNumber, + "cthing.dependencies" to libs.cthingProjectVersion.get().toString(), + "cthing.gradle.plugins" to gradlePlugin.plugins["cthingVersioningPlugin"].id)) + } + } + val repoUrl = if ((version as ProjectVersion).isSnapshotBuild) findProperty("cthing.nexus.snapshotsUrl") else findProperty("cthing.nexus.candidatesUrl") if (repoUrl != null) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ec1ab77..45bc8d6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,22 +1,22 @@ [versions] java = "17" -checkstyle = "10.20.2" +checkstyle = "10.21.2" jacoco = "0.8.12" -junit = "5.11.3" -spotbugs = "4.8.6" +junit = "5.11.4" +spotbugs = "4.9.0" [plugins] -dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = "2.6.0" } -pluginPublish = { id = "com.gradle.plugin-publish", version = "1.3.0" } -spotbugs = { id = "com.github.spotbugs", version = "6.0.26" } -versions = { id = "com.github.ben-manes.versions", version = "0.51.0" } +dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = "2.8.0" } +pluginPublish = { id = "com.gradle.plugin-publish", version = "1.3.1" } +spotbugs = { id = "com.github.spotbugs", version = "6.1.3" } +versions = { id = "com.github.ben-manes.versions", version = "0.52.0" } [libraries] -assertJ = "org.assertj:assertj-core:3.26.3" +assertJ = "org.assertj:assertj-core:3.27.3" cthingProjectVersion = "org.cthing:cthing-projectversion:2.0.0" jspecify = "org.jspecify:jspecify:1.0.0" junitApi = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" } junitEngine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" } -junitLauncher = "org.junit.platform:junit-platform-launcher:1.11.2" +junitLauncher = "org.junit.platform:junit-platform-launcher:1.11.4" junitParams = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit" } -spotbugsContrib = "com.mebigfatguy.sb-contrib:sb-contrib:7.6.5" +spotbugsContrib = "com.mebigfatguy.sb-contrib:sb-contrib:7.6.9" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e2847c8..e18bc25 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME