Skip to content

Commit 0778325

Browse files
committed
Migrate to gradle-cthing-publishing.
1 parent 0455fd2 commit 0778325

File tree

2 files changed

+7
-34
lines changed

2 files changed

+7
-34
lines changed

build.gradle.kts

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ plugins {
2121
checkstyle
2222
`maven-publish`
2323
signing
24+
alias(libs.plugins.cthingPublishing)
2425
alias(libs.plugins.cthingVersioning)
2526
alias(libs.plugins.dependencyAnalysis)
2627
alias(libs.plugins.spotbugs)
@@ -139,55 +140,26 @@ publishing {
139140
artifact(sourceJar)
140141
artifact(javadocJar)
141142

142-
pom {
143-
name = project.name
144-
description = project.description
145-
url = "https://github.com/cthing/${project.name}"
146-
licenses {
147-
license {
148-
name = "Apache-2.0"
149-
url = "https://www.apache.org/licenses/LICENSE-2.0"
150-
}
151-
}
152-
developers {
153-
developer {
154-
id = "baron"
155-
name = "Baron Roberts"
156-
157-
organization = "C Thing Software"
158-
organizationUrl = "https://www.cthing.com"
159-
}
160-
}
161-
scm {
162-
connection = "scm:git:https://github.com/cthing/${project.name}.git"
163-
developerConnection = "scm:git:[email protected]:cthing/${project.name}.git"
164-
url = "https://github.com/cthing/${project.name}"
165-
}
166-
issueManagement {
167-
system = "GitHub Issues"
168-
url = "https://github.com/cthing/${project.name}/issues"
169-
}
170-
}
143+
pom(cthingPublishing.createPomAction())
171144
}
172145
}
173146

174-
val repoUrl = if ((version as ProjectVersion).isSnapshotBuild)
175-
findProperty("cthing.nexus.snapshotsUrl") else findProperty("cthing.nexus.candidatesUrl")
147+
val repoUrl = cthingRepo.repoUrl
176148
if (repoUrl != null) {
177149
repositories {
178150
maven {
179151
name = "CThingMaven"
180152
setUrl(repoUrl)
181153
credentials {
182-
username = property("cthing.nexus.user") as String
183-
password = property("cthing.nexus.password") as String
154+
username = cthingRepo.user
155+
password = cthingRepo.password
184156
}
185157
}
186158
}
187159
}
188160
}
189161

190-
if (hasProperty("signing.keyId") && hasProperty("signing.password") && hasProperty("signing.secretKeyRingFile")) {
162+
if (cthingPublishing.canSign()) {
191163
signing {
192164
sign(publishing.publications["jar"])
193165
}

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ checkstyle = "10.20.2"
44
spotbugs = "4.8.6"
55

66
[plugins]
7+
cthingPublishing = { id = "org.cthing.cthing-publishing", version = "1.0.0" }
78
cthingVersioning = { id = "org.cthing.cthing-versioning", version = "3.0.0" }
89
dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = "2.6.0" }
910
spotbugs = { id = "com.github.spotbugs", version = "6.0.26" }

0 commit comments

Comments
 (0)