diff --git a/partiql-ast/build.gradle.kts b/partiql-ast/build.gradle.kts index c5e94c9ce..5d97131c7 100644 --- a/partiql-ast/build.gradle.kts +++ b/partiql-ast/build.gradle.kts @@ -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" diff --git a/partiql-coverage/build.gradle.kts b/partiql-coverage/build.gradle.kts index 9765b4d56..f99d60e1f 100644 --- a/partiql-coverage/build.gradle.kts +++ b/partiql-coverage/build.gradle.kts @@ -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() { diff --git a/partiql-eval/build.gradle.kts b/partiql-eval/build.gradle.kts index e9ad56502..e169ad8a7 100644 --- a/partiql-eval/build.gradle.kts +++ b/partiql-eval/build.gradle.kts @@ -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() { diff --git a/partiql-plan/build.gradle.kts b/partiql-plan/build.gradle.kts index 63683435a..37ee2104c 100644 --- a/partiql-plan/build.gradle.kts +++ b/partiql-plan/build.gradle.kts @@ -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 diff --git a/partiql-planner/build.gradle.kts b/partiql-planner/build.gradle.kts index 6cc00ec32..11c7dc9c9 100644 --- a/partiql-planner/build.gradle.kts +++ b/partiql-planner/build.gradle.kts @@ -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 { diff --git a/partiql-spi/build.gradle.kts b/partiql-spi/build.gradle.kts index 27a3016a6..e38283bea 100644 --- a/partiql-spi/build.gradle.kts +++ b/partiql-spi/build.gradle.kts @@ -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" diff --git a/partiql-types/build.gradle.kts b/partiql-types/build.gradle.kts index b7559baac..b4fd0246e 100644 --- a/partiql-types/build.gradle.kts +++ b/partiql-types/build.gradle.kts @@ -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"