Skip to content

Commit

Permalink
Upgrade Gradle and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
baron1405 committed Feb 7, 2025
1 parent 4d09941 commit 7511242
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 11 deletions.
55 changes: 55 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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) {
Expand Down
20 changes: 10 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7511242

Please sign in to comment.