From f78d414975fb3d4593da086d588627772bcf1861 Mon Sep 17 00:00:00 2001 From: Mateusz Rzeszutek Date: Tue, 6 Jul 2021 12:15:06 +0200 Subject: [PATCH] Publish armeria-shaded-for-testing without -all classifier (#3475) * Publish armeria-shaded-for-testing without -all classifier * Update testing-common/build.gradle.kts Co-authored-by: Trask Stalnaker * compileOnly Co-authored-by: Trask Stalnaker --- testing-common/build.gradle.kts | 9 ++++++++- .../armeria-shaded-for-testing/build.gradle.kts | 16 ++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/testing-common/build.gradle.kts b/testing-common/build.gradle.kts index f2be11f770..feaaa2de67 100644 --- a/testing-common/build.gradle.kts +++ b/testing-common/build.gradle.kts @@ -6,6 +6,13 @@ plugins { description = "OpenTelemetry Javaagent testing commons" group = "io.opentelemetry.javaagent" +sourceSets { + main { + val armeriaShadedDeps = project(":testing:armeria-shaded-for-testing") + output.dir(armeriaShadedDeps .file("build/extracted/shadow"), "builtBy" to ":testing:armeria-shaded-for-testing:extractShadowJar") + } +} + dependencies { api("org.codehaus.groovy:groovy-all") api("org.spockframework:spock-core") @@ -17,7 +24,7 @@ dependencies { api("io.opentelemetry:opentelemetry-sdk-metrics") api("io.opentelemetry:opentelemetry-sdk-testing") - api(project(path = ":testing:armeria-shaded-for-testing", configuration = "shadow")) + compileOnly(project(path = ":testing:armeria-shaded-for-testing", configuration = "shadow")) implementation("io.opentelemetry:opentelemetry-proto") { // Only need the proto, not gRPC. diff --git a/testing/armeria-shaded-for-testing/build.gradle.kts b/testing/armeria-shaded-for-testing/build.gradle.kts index 43a87c4ac4..f7277a8a7c 100644 --- a/testing/armeria-shaded-for-testing/build.gradle.kts +++ b/testing/armeria-shaded-for-testing/build.gradle.kts @@ -2,11 +2,8 @@ plugins { id("com.github.johnrengelman.shadow") id("otel.java-conventions") - id("otel.publish-conventions") } -group = "io.opentelemetry.javaagent" - dependencies { implementation("com.linecorp.armeria:armeria-junit5:1.8.0") { // We don't use JSON features of Armeria but shading it in can cause version conflicts with @@ -28,4 +25,15 @@ tasks { relocate("META-INF/native/netty", "META-INF/native/io_opentelemetry_testing_internal_netty") mergeServiceFiles() } -} \ No newline at end of file + + val extractShadowJar by registering(Copy::class) { + dependsOn(shadowJar) + // there's both "LICENSE" file and "license" and without excluding one of these build fails on case insensitive file systems + // there's a LICENSE.txt file that has the same contents anyway, so we're not losing anything excluding that + from(zipTree(shadowJar.get().archiveFile)) { + exclude("META-INF/LICENSE") + } + into("build/extracted/shadow") + includeEmptyDirs = false + } +}