Skip to content

Commit 6ac2d45

Browse files
committed
build: Restore separate jdbc-proto artifact for better visibility
Separates proto files from jdbc-grpc classifier artifact into a dedicated jdbc-proto. This improves visibility and accessibility of the proto files for consumers who need them without requiring the full grpc implementation.
1 parent fcc6fe6 commit 6ac2d45

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
val hyperApiVersion: String by project
7-
val hyperZipName = "hyper-$hyperApiVersion.zip"
7+
val hypzerZipPath = ".hyper/hyper-$hyperApiVersion.zip"
88

99
tasks.register<de.undercouch.gradle.tasks.download.Download>("downloadHyper") {
1010
group = "hyper"
@@ -18,7 +18,7 @@ tasks.register<de.undercouch.gradle.tasks.download.Download>("downloadHyper") {
1818
val url = "$urlBase.$hyperApiVersion.zip"
1919

2020
src(url)
21-
dest(project.layout.buildDirectory.file(hyperZipName))
21+
dest(project.layout.projectDirectory.file(hypzerZipPath))
2222
overwrite(false)
2323
}
2424

@@ -29,7 +29,7 @@ tasks.register<Copy>("extractHyper") {
2929
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
3030
includeEmptyDirs = false
3131

32-
from(zipTree(project.layout.buildDirectory.file(hyperZipName))) {
32+
from(zipTree(project.layout.projectDirectory.file(hypzerZipPath))) {
3333
include("**/lib/hyper/hyperd")
3434
include("**/lib/hyper/hyperd.exe")
3535
include("**/lib/**/*.dylib")

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ publishing {
6161
publications {
6262
create<MavenPublication>("mavenJava") {
6363
from(components["java"])
64-
// artifact(tasks())
6564
}
6665
}
6766
repositories {
@@ -129,6 +128,7 @@ fun MavenPublication.updateName() {
129128
"jdbc" -> "Salesforce Data Cloud JDBC Driver"
130129
"jdbc-core" -> "Salesforce Data Cloud JDBC Core"
131130
"jdbc-grpc" -> "Salesforce Data Cloud JDBC gRPC"
131+
"jdbc-proto" -> "Salesforce Data Cloud JDBC Proto Files"
132132
else -> {
133133
logger.lifecycle("Unknown project, can't update name. artifactId=${this.artifactId}")
134134
null
@@ -146,6 +146,7 @@ fun MavenPublication.updateDescription() {
146146
"jdbc" -> "Salesforce Data Cloud JDBC driver"
147147
"jdbc-core" -> "Salesforce Data Cloud JDBC core implementation"
148148
"jdbc-grpc" -> "Salesforce Data Cloud Query v3 API gRPC stubs"
149+
"jdbc-proto" -> "Salesforce Data Cloud Query API proto files"
149150
else -> {
150151
logger.lifecycle("Unknown project, can't update description. artifactId=${this.artifactId}")
151152
null

jdbc-core/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
dependencies {
8-
api(project(":jdbc-grpc"))
8+
compileOnly(project(":jdbc-grpc"))
99

1010
implementation(libs.slf4j.api)
1111

@@ -31,6 +31,7 @@ dependencies {
3131

3232
runtimeOnly(libs.jjwt.jackson)
3333

34+
testImplementation(project(":jdbc-grpc"))
3435
testImplementation(platform(libs.junit.bom))
3536
testImplementation(libs.bundles.testing)
3637
testImplementation(libs.bundles.mocking)

jdbc-grpc/build.gradle.kts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,44 @@ tasks.withType<JavaCompile> {
3838

3939
val protoJar by tasks.registering(Jar::class) {
4040
group = LifecycleBasePlugin.BUILD_GROUP
41-
archiveClassifier.set("proto")
41+
archiveBaseName.set("jdbc-proto")
4242
from(project.projectDir.resolve("src/main/proto"))
43+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
4344
}
4445

4546
tasks.jar {
47+
archiveBaseName.set("jdbc-grpc")
4648
val tasks = sourceSets.map { sourceSet ->
4749
from(sourceSet.output)
4850
sourceSet.getCompileTaskName("java")
4951
}.toTypedArray()
5052

5153
dependsOn(protoJar, *tasks)
5254

53-
duplicatesStrategy = DuplicatesStrategy.INCLUDE
55+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
56+
}
57+
58+
val emptySourcesJar by tasks.registering(Jar::class) {
59+
archiveClassifier.set("sources")
60+
archiveBaseName.set("jdbc-proto")
61+
}
62+
63+
val emptyJavadocJar by tasks.registering(Jar::class) {
64+
archiveClassifier.set("javadoc")
65+
archiveBaseName.set("jdbc-proto")
5466
}
5567

5668
publishing {
5769
publications {
5870
named<MavenPublication>("mavenJava") {
71+
artifactId = "jdbc-grpc"
72+
}
73+
74+
create<MavenPublication>("mavenProto") {
75+
artifactId = "jdbc-proto"
5976
artifact(protoJar)
77+
artifact(emptySourcesJar)
78+
artifact(emptyJavadocJar)
6079
}
6180
}
6281
}

0 commit comments

Comments
 (0)