diff --git a/build.gradle.kts b/build.gradle.kts index 819f1ef..38b5905 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,6 +22,7 @@ plugins { jacoco `maven-publish` signing + alias(libs.plugins.cthingPublishing) alias(libs.plugins.cthingVersioning) alias(libs.plugins.dependencyAnalysis) alias(libs.plugins.spotbugs) @@ -174,55 +175,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"]) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 063eb66..edaa36a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,6 +6,7 @@ junit = "5.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" }