Skip to content

Commit 1ad520f

Browse files
committed
Migrate to gradle-cthing-publishing.
1 parent 090b4f6 commit 1ad520f

2 files changed

Lines changed: 7 additions & 34 deletions

File tree

build.gradle.kts

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ plugins {
2222
jacoco
2323
`maven-publish`
2424
signing
25+
alias(libs.plugins.cthingPublishing)
2526
alias(libs.plugins.cthingVersioning)
2627
alias(libs.plugins.dependencyAnalysis)
2728
alias(libs.plugins.spotbugs)
@@ -180,55 +181,26 @@ publishing {
180181
artifact(sourceJar)
181182
artifact(javadocJar)
182183

183-
pom {
184-
name = project.name
185-
description = project.description
186-
url = "https://github.com/cthing/${project.name}"
187-
licenses {
188-
license {
189-
name = "Apache-2.0"
190-
url = "https://www.apache.org/licenses/LICENSE-2.0"
191-
}
192-
}
193-
developers {
194-
developer {
195-
id = "baron"
196-
name = "Baron Roberts"
197-
email = "baron@cthing.com"
198-
organization = "C Thing Software"
199-
organizationUrl = "https://www.cthing.com"
200-
}
201-
}
202-
scm {
203-
connection = "scm:git:https://github.com/cthing/${project.name}.git"
204-
developerConnection = "scm:git:git@github.com:cthing/${project.name}.git"
205-
url = "https://github.com/cthing/${project.name}"
206-
}
207-
issueManagement {
208-
system = "GitHub Issues"
209-
url = "https://github.com/cthing/${project.name}/issues"
210-
}
211-
}
184+
pom(cthingPublishing.createPomAction())
212185
}
213186
}
214187

215-
val repoUrl = if ((version as ProjectVersion).isSnapshotBuild)
216-
findProperty("cthing.nexus.snapshotsUrl") else findProperty("cthing.nexus.candidatesUrl")
188+
val repoUrl = cthingRepo.repoUrl
217189
if (repoUrl != null) {
218190
repositories {
219191
maven {
220192
name = "CThingMaven"
221193
setUrl(repoUrl)
222194
credentials {
223-
username = property("cthing.nexus.user") as String
224-
password = property("cthing.nexus.password") as String
195+
username = cthingRepo.user
196+
password = cthingRepo.password
225197
}
226198
}
227199
}
228200
}
229201
}
230202

231-
if (hasProperty("signing.keyId") && hasProperty("signing.password") && hasProperty("signing.secretKeyRingFile")) {
203+
if (cthingPublishing.canSign()) {
232204
signing {
233205
sign(publishing.publications["jar"])
234206
}

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ junit = "5.11.3"
77
spotbugs = "4.8.6"
88

99
[plugins]
10+
cthingPublishing = { id = "org.cthing.cthing-publishing", version = "1.0.0" }
1011
cthingVersioning = { id = "org.cthing.cthing-versioning", version = "3.0.0" }
1112
dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = "2.6.0" }
1213
spotbugs = { id = "com.github.spotbugs", version = "6.0.26" }

0 commit comments

Comments
 (0)