aboutsummaryrefslogtreecommitdiff
path: root/agent/build.gradle.kts
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-11-01 18:50:11 +0100
committernea <nea@nea.moe>2023-11-01 18:50:11 +0100
commit297cb01f220a617dd08096467978b2fccbc27695 (patch)
treed467f358313ce3648063da41b66361a840fa7864 /agent/build.gradle.kts
parentd5253dc5c3ae7b2cc1fcb96780e43b929a449eb4 (diff)
downloadModernJavaLauncher-297cb01f220a617dd08096467978b2fccbc27695.tar.gz
ModernJavaLauncher-297cb01f220a617dd08096467978b2fccbc27695.tar.bz2
ModernJavaLauncher-297cb01f220a617dd08096467978b2fccbc27695.zip
Add documentation
Diffstat (limited to 'agent/build.gradle.kts')
-rw-r--r--agent/build.gradle.kts39
1 files changed, 39 insertions, 0 deletions
diff --git a/agent/build.gradle.kts b/agent/build.gradle.kts
new file mode 100644
index 0000000..983f917
--- /dev/null
+++ b/agent/build.gradle.kts
@@ -0,0 +1,39 @@
+plugins {
+ java
+ id("com.github.johnrengelman.shadow") version "7.1.2"
+}
+
+java {
+ toolchain.languageVersion.set(JavaLanguageVersion.of(11))
+}
+
+
+val shadowOnly: Configuration by configurations.creating {
+ attributes {
+ this.attribute(org.gradle.api.attributes.java.TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 11)
+ }
+}
+
+dependencies {
+ shadowOnly(implementation("org.ow2.asm:asm:9.4")!!)
+ shadowOnly(implementation("org.ow2.asm:asm-commons:9.4")!!)
+ shadowOnly("dev.architectury:architectury-pack200:0.1.3")
+}
+tasks.withType(Jar::class) {
+ manifest {
+ attributes.apply {
+ this["Premain-Class"] = "moe.nea.modernjava.agent.Pack200Retransformer"
+ }
+ }
+}
+
+tasks.shadowJar {
+ archiveClassifier.set("")
+ configurations = listOf(shadowOnly)
+ relocate("org.objectweb.asm", "moe.nea.modernjava.agent.dep.asm")
+ // relocate("dev.architectury.pack200.java", "java.util.jar")
+}
+tasks.jar {
+ archiveClassifier.set("thin")
+}
+tasks.assemble.get().dependsOn(tasks.shadowJar) \ No newline at end of file