aboutsummaryrefslogtreecommitdiff
path: root/build.gradle.kts
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <roman.graef@gmail.com>2022-11-22 20:22:20 +0100
committerGitHub <noreply@github.com>2022-11-22 20:22:20 +0100
commita17412e1f1c829dd6d085b4849dae4ca571fd16b (patch)
treeaa7b0edebbe8f027d2e093fb534c35fb16a3ec2f /build.gradle.kts
parent3d37cee20ddcf92b47144cb1e3ae25785a5e8bc2 (diff)
downloadNotEnoughUpdates-a17412e1f1c829dd6d085b4849dae4ca571fd16b.tar.gz
NotEnoughUpdates-a17412e1f1c829dd6d085b4849dae4ca571fd16b.tar.bz2
NotEnoughUpdates-a17412e1f1c829dd6d085b4849dae4ca571fd16b.zip
Terrible Kotlin! (#435)
* Terrible Kotlin! You are unloved and everybody dies * Load Kotlin via a Tweaker * Fix version comparison * Allow user to prevent loading of Kotlin libraries using system properties * Remove testing files
Diffstat (limited to 'build.gradle.kts')
-rw-r--r--build.gradle.kts27
1 files changed, 25 insertions, 2 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index defc1052..a661d6be 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -30,6 +30,7 @@ plugins {
id("com.github.johnrengelman.shadow") version "7.1.2"
id("io.github.juuxel.loom-quiltflower") version "1.7.3"
`maven-publish`
+ kotlin("jvm") version "1.7.20"
}
@@ -47,7 +48,7 @@ loom {
"client" {
property("mixin.debug", "true")
property("asmhelper.verbose", "true")
- arg("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker")
+ arg("--tweakClass", "io.github.moulberry.notenoughupdates.loader.NEUDelegatingTweaker")
arg("--mixin", "mixins.notenoughupdates.json")
}
}
@@ -90,11 +91,21 @@ val devEnv by configurations.creating {
isVisible = false
}
+val kotlinDependencies by configurations.creating {
+ configurations.implementation.get().extendsFrom(this)
+}
+
dependencies {
+ implementation("org.projectlombok:lombok:1.18.22")
minecraft("com.mojang:minecraft:1.8.9")
mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9")
forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9")
+
+ // Please keep this version in sync with KotlinLoadingTweaker
+ implementation(enforcedPlatform("org.jetbrains.kotlin:kotlin-bom:1.7.21"))
+ kotlinDependencies(kotlin("stdlib"))
+
shadowImplementation("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
isTransitive = false // Dependencies of mixin are already bundled by minecraft
}
@@ -128,7 +139,7 @@ tasks.withType(Jar::class) {
archiveBaseName.set("NotEnoughUpdates")
manifest.attributes.run {
this["Main-Class"] = "NotSkyblockAddonsInstallerFrame"
- this["TweakClass"] = "org.spongepowered.asm.launch.MixinTweaker"
+ this["TweakClass"] = "io.github.moulberry.notenoughupdates.loader.NEUDelegatingTweaker"
this["MixinConfigs"] = "mixins.notenoughupdates.json"
this["FMLCorePluginContainsFMLMod"] = "true"
this["ForceLoadAsMod"] = "true"
@@ -145,6 +156,16 @@ val remapJar by tasks.named<net.fabricmc.loom.task.RemapJarTask>("remapJar") {
}
}
+/* Bypassing https://github.com/johnrengelman/shadow/issues/111 */
+// Use Zip instead of Jar as to not include META-INF
+val kotlinDependencyCollectionJar by tasks.creating(Zip::class) {
+ archiveFileName.set("kotlin-libraries-wrapped.jar")
+ destinationDirectory.set(project.layout.buildDirectory.dir("kotlinwrapper"))
+ from(kotlinDependencies.files)
+ into("neu-kotlin-libraries-wrapped")
+}
+
+
tasks.shadowJar {
archiveClassifier.set("dep-dev")
configurations = listOf(shadowImplementation, shadowApi)
@@ -155,6 +176,8 @@ tasks.shadowJar {
listOf("logback-classic", "commons-logging", "commons-codec", "logback-core")
}
}
+ from(kotlinDependencyCollectionJar)
+ dependsOn(kotlinDependencyCollectionJar)
fun relocate(name: String) = relocate(name, "io.github.moulberry.notenoughupdates.deps.$name")
}