Skip to content

Commit 23008ee

Browse files
authored
Update POM for new name (#186)
Update POM for Develocity rename and publish a relocation POM. Part of #184
1 parent 294e25a commit 23008ee

File tree

2 files changed

+48
-26
lines changed

2 files changed

+48
-26
lines changed

.github/workflows/publish-library.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ jobs:
3030
- name: Verify that version property matches tag
3131
if: ${{ inputs.dry_run != true }}
3232
run: grep -qP '^version=${{ github.ref_name }}$' gradle.properties
33-
- name: gradle publishLibraryPublicationToMavenCentralRepository
33+
- name: gradle publish
3434
uses: ./.github/actions/build
3535
with:
3636
dry-run: ${{ inputs.dry_run }}
3737
args: >-
38-
publishLibraryPublicationToMavenCentralRepository
38+
publishDevelocityApiKotlinPublicationToMavenCentralRepository
39+
publishRelocationPublicationToMavenCentralRepository
3940
--rerun-tasks
4041
'-Pmaven.central.username=${{ secrets.MAVEN_CENTRAL_USERNAME }}'
4142
'-Pmaven.central.password=${{ secrets.MAVEN_CENTRAL_PASSWORD }}'

library/build.gradle.kts

Lines changed: 45 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -82,35 +82,56 @@ dependencies {
8282
integrationTestImplementation("com.google.guava:guava:33.1.0-jre")
8383
}
8484

85+
fun libraryPom() = Action<MavenPom> {
86+
name.set("Gradle Enterprise API Kotlin")
87+
description.set("A library to use the Gradle Enterprise REST API in Kotlin")
88+
url.set("https://github.com/gabrielfeo/gradle-enterprise-api-kotlin")
89+
licenses {
90+
license {
91+
name.set("MIT")
92+
url.set("https://spdx.org/licenses/MIT.html")
93+
distribution.set("repo")
94+
}
95+
}
96+
developers {
97+
developer {
98+
id.set("gabrielfeo")
99+
name.set("Gabriel Feo")
100+
email.set("gabriel@gabrielfeo.com")
101+
}
102+
}
103+
scm {
104+
val basicUrl = "github.com/gabrielfeo/gradle-enterprise-api-kotlin"
105+
connection.set("scm:git:git://$basicUrl.git")
106+
developerConnection.set("scm:git:ssh://$basicUrl.git")
107+
url.set("https://$basicUrl/")
108+
}
109+
}
110+
85111
publishing {
86112
publications {
87-
create<MavenPublication>("library") {
88-
artifactId = "gradle-enterprise-api-kotlin"
113+
create<MavenPublication>("develocityApiKotlin") {
114+
artifactId = "develocity-api-kotlin"
89115
from(components["java"])
116+
pom(libraryPom())
117+
}
118+
// For occasional maven local publishing
119+
create<MavenPublication>("unsignedDevelocityApiKotlin") {
120+
artifactId = "develocity-api-kotlin"
121+
from(components["java"])
122+
pom(libraryPom())
123+
}
124+
create<MavenPublication>("relocation") {
90125
pom {
91-
name.set("Gradle Enterprise API Kotlin")
92-
description.set("A library to use the Gradle Enterprise REST API in Kotlin")
93-
url.set("https://github.com/gabrielfeo/gradle-enterprise-api-kotlin")
94-
licenses {
95-
license {
96-
name.set("MIT")
97-
url.set("https://spdx.org/licenses/MIT.html")
98-
distribution.set("repo")
126+
groupId = project.group.toString()
127+
artifactId = "gradle-enterprise-api-kotlin"
128+
distributionManagement {
129+
relocation {
130+
groupId = project.group.toString()
131+
artifactId = "develocity-api-kotlin"
132+
message = "artifactId has been changed. Part of the rename to Develocity."
99133
}
100134
}
101-
developers {
102-
developer {
103-
id.set("gabrielfeo")
104-
name.set("Gabriel Feo")
105-
email.set("gabriel@gabrielfeo.com")
106-
}
107-
}
108-
scm {
109-
val basicUrl = "github.com/gabrielfeo/gradle-enterprise-api-kotlin"
110-
connection.set("scm:git:git://$basicUrl.git")
111-
developerConnection.set("scm:git:ssh://$basicUrl.git")
112-
url.set("https://$basicUrl/")
113-
}
114135
}
115136
}
116137
}
@@ -135,7 +156,7 @@ publishing {
135156
fun isCI() = System.getenv("CI").toBoolean()
136157

137158
signing {
138-
sign(publishing.publications["library"])
159+
sign(publishing.publications["develocityApiKotlin"])
139160
if (isCI()) {
140161
useInMemoryPgpKeys(
141162
project.properties["signing.secretKey"] as String?,

0 commit comments

Comments
 (0)