Skip to content

Commit

Permalink
Migrate to gradle-cthing-publishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
baron1405 committed Feb 3, 2025
1 parent 39e68e6 commit cd55337
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 34 deletions.
40 changes: 6 additions & 34 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ plugins {
jacoco
`maven-publish`
signing
alias(libs.plugins.cthingPublishing)
alias(libs.plugins.cthingVersioning)
alias(libs.plugins.dependencyAnalysis)
alias(libs.plugins.spotbugs)
Expand Down Expand Up @@ -201,55 +202,26 @@ publishing {
artifact(sourceJar)
artifact(javadocJar)

pom {
name = project.name
description = project.description
url = "https://github.com/cthing/${project.name}"
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"
}
}
pom(cthingPublishing.createPomAction())
}
}

val repoUrl = if ((version as ProjectVersion).isSnapshotBuild)
findProperty("cthing.nexus.snapshotsUrl") else findProperty("cthing.nexus.candidatesUrl")
val repoUrl = cthingRepo.repoUrl
if (repoUrl != null) {
repositories {
maven {
name = "CThingMaven"
setUrl(repoUrl)
credentials {
username = property("cthing.nexus.user") as String
password = property("cthing.nexus.password") as String
username = cthingRepo.user
password = cthingRepo.password
}
}
}
}
}

if (hasProperty("signing.keyId") && hasProperty("signing.password") && hasProperty("signing.secretKeyRingFile")) {
if (cthingPublishing.canSign()) {
signing {
sign(publishing.publications["jar"])
}
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ junitPlatform = "1.11.3"
spotbugs = "4.8.6"

[plugins]
cthingPublishing = { id = "org.cthing.cthing-publishing", version = "1.0.0" }
cthingVersioning = { id = "org.cthing.cthing-versioning", version = "3.0.0" }
dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = "2.6.0" }
spotbugs = { id = "com.github.spotbugs", version = "6.0.26" }
Expand Down

0 comments on commit cd55337

Please sign in to comment.