Skip to content

Commit

Permalink
Cherry picks #1504 (Fix published jars for non-shadowed packages) (#1505
Browse files Browse the repository at this point in the history
))

* Fix published jars for non-shadowed packages

(cherry picked from commit 6b49fc1)

* Apply patch for partiql-eval
  • Loading branch information
alancai98 authored Jul 10, 2024
1 parent 5b86afc commit 7ed91d2
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 0 deletions.
11 changes: 11 additions & 0 deletions partiql-ast/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ dependencies {
api(project(":partiql-types"))
}

tasks.shadowJar {
configurations = listOf(project.configurations.shadow.get())
}

// Workaround for https://github.com/johnrengelman/shadow/issues/651
components.withType(AdhocComponentWithVariants::class.java).forEach { c ->
c.withVariantsFromConfiguration(project.configurations.shadowRuntimeElements.get()) {
skip()
}
}

publish {
artifactId = "partiql-ast"
name = "PartiQL AST"
Expand Down
11 changes: 11 additions & 0 deletions partiql-coverage/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ dependencies {
implementation(Deps.jgenhtml)
}

tasks.shadowJar {
configurations = listOf(project.configurations.shadow.get())
}

// Workaround for https://github.com/johnrengelman/shadow/issues/651
components.withType(AdhocComponentWithVariants::class.java).forEach { c ->
c.withVariantsFromConfiguration(project.configurations.shadowRuntimeElements.get()) {
skip()
}
}

// Need to add this as we have both Java and Kotlin sources. Dokka already handles multi-language projects. If
// Javadoc is enabled, we end up overwriting index.html (causing compilation errors).
tasks.withType<Javadoc>() {
Expand Down
11 changes: 11 additions & 0 deletions partiql-eval/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ kotlin {
explicitApi = null
}

tasks.shadowJar {
configurations = listOf(project.configurations.shadow.get())
}

// Workaround for https://github.com/johnrengelman/shadow/issues/651
components.withType(AdhocComponentWithVariants::class.java).forEach { c ->
c.withVariantsFromConfiguration(project.configurations.shadowRuntimeElements.get()) {
skip()
}
}

// Need to add this as we have both Java and Kotlin sources. Dokka already handles multi-language projects. If
// Javadoc is enabled, we end up overwriting index.html (causing compilation errors).
tasks.withType<Javadoc>() {
Expand Down
11 changes: 11 additions & 0 deletions partiql-plan/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ dependencies {
implementation(Deps.kotlinReflect)
}

tasks.shadowJar {
configurations = listOf(project.configurations.shadow.get())
}

// Workaround for https://github.com/johnrengelman/shadow/issues/651
components.withType(AdhocComponentWithVariants::class.java).forEach { c ->
c.withVariantsFromConfiguration(project.configurations.shadowRuntimeElements.get()) {
skip()
}
}

// Disabled for partiql-plan project.
kotlin {
explicitApi = null
Expand Down
11 changes: 11 additions & 0 deletions partiql-planner/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ dependencies {
testFixturesImplementation(project(":partiql-spi"))
}

tasks.shadowJar {
configurations = listOf(project.configurations.shadow.get())
}

// Workaround for https://github.com/johnrengelman/shadow/issues/651
components.withType(AdhocComponentWithVariants::class.java).forEach { c ->
c.withVariantsFromConfiguration(project.configurations.shadowRuntimeElements.get()) {
skip()
}
}

tasks.register("generateResourcePath") {
dependsOn("processTestFixturesResources")
doLast {
Expand Down
11 changes: 11 additions & 0 deletions partiql-spi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ dependencies {
testImplementation(Deps.kasechange)
}

tasks.shadowJar {
configurations = listOf(project.configurations.shadow.get())
}

// Workaround for https://github.com/johnrengelman/shadow/issues/651
components.withType(AdhocComponentWithVariants::class.java).forEach { c ->
c.withVariantsFromConfiguration(project.configurations.shadowRuntimeElements.get()) {
skip()
}
}

publish {
artifactId = "partiql-spi"
name = "PartiQL SPI"
Expand Down
11 changes: 11 additions & 0 deletions partiql-types/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ dependencies {
implementation(Deps.kotlinxCollections)
}

tasks.shadowJar {
configurations = listOf(project.configurations.shadow.get())
}

// Workaround for https://github.com/johnrengelman/shadow/issues/651
components.withType(AdhocComponentWithVariants::class.java).forEach { c ->
c.withVariantsFromConfiguration(project.configurations.shadowRuntimeElements.get()) {
skip()
}
}

publish {
artifactId = "partiql-types"
name = "PartiQL Types"
Expand Down

0 comments on commit 7ed91d2

Please sign in to comment.