From e88beabddae3521254c96db9d6561a649d1844f0 Mon Sep 17 00:00:00 2001 From: Jeromy Cannon Date: Tue, 12 Sep 2023 20:50:41 +0100 Subject: [PATCH] updates based on what Jendrik provided Signed-off-by: Jeromy Cannon --- fullstack-gradle-plugin/build.gradle.kts | 34 +++++++++++++++++++----- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/fullstack-gradle-plugin/build.gradle.kts b/fullstack-gradle-plugin/build.gradle.kts index 63f3d99e7..caa9bfb65 100644 --- a/fullstack-gradle-plugin/build.gradle.kts +++ b/fullstack-gradle-plugin/build.gradle.kts @@ -16,20 +16,40 @@ plugins { id("java-gradle-plugin") id("com.github.johnrengelman.shadow").version("8.1.1") + id("com.gradle.plugin-publish").version("1.2.1") id("com.hedera.fullstack.conventions") id("com.hedera.fullstack.maven-publish") } -dependencies { - api(platform(project(":fullstack-bom"))) - implementation(project(":fullstack-helm-client")) - implementation("org.slf4j:slf4j-api:2.0.7") +// 'internal' for dependencies that are not visible in tests and are not published +// because things are shadowed +val internal = configurations.create("internal") +configurations.compileClasspath { + extendsFrom(internal) +} +configurations.runtimeClasspath { + extendsFrom(internal) +} -// implementation(project(mapOf("path" to ":fullstack-helm-client"))) +dependencies { + internal(platform(project(":fullstack-bom"))) + internal(project(":fullstack-helm-client")) } tasks.shadowJar { - isEnableRelocation = true + relocationPrefix = "com.hedera.fullstack.shadowed" + archiveClassifier.set("") + manifest { + attributes("Multi-Release" to "true") + } + + relocate("com.fasterxml", "com.hedera.fullstack.shadowed.com.fasterxml") + relocate("org.slf4j", "com.hedera.fullstack.shadowed.org.slf4j") +} + +tasks.test { + // Use the shadow Jar with everything included instead of the classes folder + classpath = sourceSets.test.get().runtimeClasspath + files(tasks.shadowJar) } gradlePlugin { @@ -43,4 +63,4 @@ gradlePlugin { "The Fullstack Plugin provides tools for working with Fullstack infrastructure." } } -} +} \ No newline at end of file