aboutsummaryrefslogtreecommitdiff
path: root/build.gradle.kts
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-11-01 21:11:09 +0100
committernea <nea@nea.moe>2023-11-01 21:11:09 +0100
commit21ca764e26fdbb903ce380874cc2798f17de9034 (patch)
tree52931b66e52120a22d20354d0fe1adb26876cded /build.gradle.kts
parent297cb01f220a617dd08096467978b2fccbc27695 (diff)
downloadModernJavaLauncher-21ca764e26fdbb903ce380874cc2798f17de9034.tar.gz
ModernJavaLauncher-21ca764e26fdbb903ce380874cc2798f17de9034.tar.bz2
ModernJavaLauncher-21ca764e26fdbb903ce380874cc2798f17de9034.zip
Make MJL package the agent
Diffstat (limited to 'build.gradle.kts')
-rw-r--r--build.gradle.kts11
1 files changed, 11 insertions, 0 deletions
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)