Skip to content

Commit fcc6fe6

Browse files
ensure name and description are set on all publications (#34)
1 parent 2f6c89d commit fcc6fe6

File tree

4 files changed

+35
-7
lines changed

4 files changed

+35
-7
lines changed

buildSrc/src/main/kotlin/publishing-conventions.gradle.kts

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ publishing {
8181
}
8282

8383
publications.withType<MavenPublication>().configureEach {
84+
updateName()
85+
updateDescription()
8486
pom {
85-
description.set(project.description)
8687
url.set("https://github.com/forcedotcom/datacloud-jdbc")
8788

8889
scm {
@@ -122,3 +123,36 @@ tasks.withType<PublishToMavenRepository>()
122123
.configureEach {
123124
usesService(mavenPublishLimiter)
124125
}
126+
127+
fun MavenPublication.updateName() {
128+
val name = when (this.artifactId) {
129+
"jdbc" -> "Salesforce Data Cloud JDBC Driver"
130+
"jdbc-core" -> "Salesforce Data Cloud JDBC Core"
131+
"jdbc-grpc" -> "Salesforce Data Cloud JDBC gRPC"
132+
else -> {
133+
logger.lifecycle("Unknown project, can't update name. artifactId=${this.artifactId}")
134+
null
135+
}
136+
}
137+
138+
if (name != null) {
139+
pom { this.name.set(name) }
140+
}
141+
}
142+
143+
144+
fun MavenPublication.updateDescription() {
145+
val description = when (this.artifactId) {
146+
"jdbc" -> "Salesforce Data Cloud JDBC driver"
147+
"jdbc-core" -> "Salesforce Data Cloud JDBC core implementation"
148+
"jdbc-grpc" -> "Salesforce Data Cloud Query v3 API gRPC stubs"
149+
else -> {
150+
logger.lifecycle("Unknown project, can't update description. artifactId=${this.artifactId}")
151+
null
152+
}
153+
}
154+
155+
if (description != null) {
156+
pom { this.description.set(description) }
157+
}
158+
}

jdbc-core/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ plugins {
44
alias(libs.plugins.lombok)
55
}
66

7-
description = "Salesforce Data Cloud JDBC Core"
8-
97
dependencies {
108
api(project(":jdbc-grpc"))
119

jdbc-grpc/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ dependencies {
1212
implementation(libs.bundles.grpc)
1313
}
1414

15-
description = "Salesforce Data Cloud Query v3 gRPC stubs"
16-
1715
// Based on: https://github.com/google/protobuf-gradle-plugin/blob/master/examples/exampleKotlinDslProject
1816
protobuf {
1917
protoc {

jdbc/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ dependencies {
1414
testImplementation(libs.bundles.testing)
1515
}
1616

17-
description = "Salesforce Data Cloud JDBC Driver"
18-
1917
tasks.shadowJar {
2018
val shadeBase = "com.salesforce.datacloud.jdbc.internal.shaded"
2119

0 commit comments

Comments
 (0)