From 21ca764e26fdbb903ce380874cc2798f17de9034 Mon Sep 17 00:00:00 2001 From: nea Date: Wed, 1 Nov 2023 21:11:09 +0100 Subject: Make MJL package the agent --- build.gradle.kts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'build.gradle.kts') diff --git a/build.gradle.kts b/build.gradle.kts index 154215c..46deb21 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -47,6 +47,8 @@ val shadowImpl: Configuration by configurations.creating { configurations.implementation.get().extendsFrom(this) } +val agentDeps: Configuration by configurations.creating + val shadowOnly: Configuration by configurations.creating { attributes { this.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 16) @@ -63,10 +65,18 @@ dependencies { shadowImpl("com.github.Skytils:AsmHelper:91ecc2bd9c") shadowImpl(enforcedPlatform(kotlin("bom"))) shadowImpl(kotlin("stdlib")) + agentDeps(project(":agent",configuration = "agentShadow")) } // Tasks: +val doubleWrappedJar by tasks.creating(Zip::class) { + archiveFileName.set("agent.jar") + destinationDirectory.set(project.layout.buildDirectory.dir("wrapper")) + from(agentDeps) + into("agent") +} + tasks.withType(JavaCompile::class) { options.encoding = "UTF-8" } @@ -97,6 +107,7 @@ tasks.shadowJar { archiveClassifier.set("all-dev") relocate("dev.falsehonesty.asmhelper", "moe.nea.modernjava.dep.asmhelper") configurations = listOf(shadowImpl, shadowOnly) + from(doubleWrappedJar) } tasks.assemble.get().dependsOn(tasks.remapJar) -- cgit