Skip to content

Commit

Permalink
move publish property configuration into gradle.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
dtanner committed Sep 13, 2022
1 parent 0ee3c63 commit 57db748
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
18 changes: 12 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

repositories {
mavenLocal()
mavenCentral()
Expand Down Expand Up @@ -51,16 +52,21 @@ publishing {
repositories {
maven {
credentials(PasswordCredentials::class)
name = "sonatype" // correlates with the environment variable set in the github action publish job
name = "sonatype" // correlates with the environment variable set in the github action release.yml publish job
val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
setUrl(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
}
}

publications {
val projectTitle: String by project
val projectDescription: String by project
val projectUrl: String by project
val projectScm: String by project

create<MavenPublication>("mavenJava") {
artifactId = "health-monitor-interface"
artifactId = rootProject.name
from(components["java"])
versionMapping {
usage("java-api") {
Expand All @@ -71,9 +77,9 @@ publishing {
}
}
pom {
name.set("Health Monitor Interface")
description.set("Shareable health monitoring interface")
url.set("https://github.com/target/health-monitor-interface")
name.set(projectTitle)
description.set(projectDescription)
url.set(projectUrl)
licenses {
license {
name.set("MIT")
Expand All @@ -88,7 +94,7 @@ publishing {
}
}
scm {
url.set("https://github.com/target/health-monitor-interface")
url.set(projectScm)
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ kotlinCoroutinesVersion = 1.6.4
junitVersion = 5.9.0
kotestVersion = 5.4.2
mockkVersion = 1.12.7

# Properties used by the publishing plugin
projectTitle = Health Monitor Interface
projectDescription = Shareable health monitoring interface
projectUrl = https://github.com/target/health-monitor-interface
projectScm = https://github.com/target/health-monitor-interface

0 comments on commit 57db748

Please sign in to comment.