aboutsummaryrefslogtreecommitdiff
path: root/target/build.gradle.kts
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-11-01 14:02:59 +0100
committernea <nea@nea.moe>2023-11-01 14:02:59 +0100
commitd5253dc5c3ae7b2cc1fcb96780e43b929a449eb4 (patch)
tree478973510c9d7eda999b8321a07f34691ba56e8b /target/build.gradle.kts
downloadModernJavaLauncher-d5253dc5c3ae7b2cc1fcb96780e43b929a449eb4.tar.gz
ModernJavaLauncher-d5253dc5c3ae7b2cc1fcb96780e43b929a449eb4.tar.bz2
ModernJavaLauncher-d5253dc5c3ae7b2cc1fcb96780e43b929a449eb4.zip
Initial commit
Diffstat (limited to 'target/build.gradle.kts')
-rw-r--r--target/build.gradle.kts44
1 files changed, 44 insertions, 0 deletions
diff --git a/target/build.gradle.kts b/target/build.gradle.kts
new file mode 100644
index 0000000..7ffdde9
--- /dev/null
+++ b/target/build.gradle.kts
@@ -0,0 +1,44 @@
+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)
+ }
+}
+repositories {
+ mavenCentral()
+ maven("https://maven.architectury.dev/")
+ maven("https://repository.ow2.org/nexus/content/repositories/releases/")
+}
+
+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.target.Pack200Retransformer"
+ }
+ }
+}
+
+tasks.shadowJar {
+ archiveClassifier.set("")
+ configurations = listOf(shadowOnly)
+ relocate("org.objectweb.asm", "moe.nea.modernjava.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