diff options
-rw-r--r-- | build-src/build.gradle.kts | 4 | ||||
-rw-r--r-- | build-src/src/main/kotlin/ledger-globals.gradle.kts | 9 | ||||
-rw-r--r-- | build.gradle.kts | 51 | ||||
-rw-r--r-- | gradle/wrapper/gradle-wrapper.properties | 2 | ||||
-rw-r--r-- | settings.gradle.kts | 10 | ||||
-rw-r--r-- | src/main/resources/mixins.moneyledger.json | 1 |
6 files changed, 30 insertions, 47 deletions
diff --git a/build-src/build.gradle.kts b/build-src/build.gradle.kts index f203fd6..5e53bfc 100644 --- a/build-src/build.gradle.kts +++ b/build-src/build.gradle.kts @@ -1,11 +1,11 @@ plugins { - kotlin("jvm") version "2.0.20" + `embedded-kotlin` `kotlin-dsl` } repositories { mavenCentral() } dependencies { - implementation("com.google.code.gson:gson:2.11.0") + implementation("com.google.code.gson:gson:2.9.1") // Match loom :) implementation(gradleApi()) } diff --git a/build-src/src/main/kotlin/ledger-globals.gradle.kts b/build-src/src/main/kotlin/ledger-globals.gradle.kts index 0d1c3c4..036c63d 100644 --- a/build-src/src/main/kotlin/ledger-globals.gradle.kts +++ b/build-src/src/main/kotlin/ledger-globals.gradle.kts @@ -13,3 +13,12 @@ tasks.withType<AbstractArchiveTask> { this.isReproducibleFileOrder = true } +tasks.withType<Test> { + useJUnitPlatform() +} + +tasks.withType<JavaCompile> { + options.encoding = "UTF-8" +} + + diff --git a/build.gradle.kts b/build.gradle.kts index 4559556..c5ee6d5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,5 @@ import com.github.gmazzo.buildconfig.BuildConfigExtension import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar -import org.apache.commons.lang3.SystemUtils import proguard.gradle.ProGuardTask import java.io.ByteArrayOutputStream @@ -16,7 +15,7 @@ buildscript { plugins { idea java - id("gg.essential.loom") version "0.10.0.+" + id("gg.essential.loom") version "1.6.+" id("dev.architectury.architectury-pack200") version "0.1.3" id("com.github.johnrengelman.shadow") version "8.1.1" id("com.github.gmazzo.buildconfig") version "5.5.0" @@ -56,31 +55,21 @@ java { // Minecraft configuration: loom { + forge { + pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter()) + mixinConfig("mixins.$modid.json") + } log4jConfigs.from(file("log4j2.xml")) - launchConfigs { + runConfigs { "client" { property("ledger.bonusresourcemod", sourceSets.main.get().output.resourcesDir!!.absolutePath) property("mixin.debug", "true") - arg("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker") - arg("--tweakClass", "io.github.notenoughupdates.moulconfig.tweaker.DevelopmentResourceTweaker") - } - } - runConfigs { - "client" { - if (SystemUtils.IS_OS_MAC_OSX) { - // This argument causes a crash on macOS - vmArgs.remove("-XstartOnFirstThread") - } + programArgs("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker") + programArgs("--tweakClass", "io.github.notenoughupdates.moulconfig.tweaker.DevelopmentResourceTweaker") } remove(getByName("server")) } - forge { - pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter()) - mixinConfig("mixins.$modid.json") - } - mixin { - defaultRefmapName.set("mixins.$modid.refmap.json") - } + mixin.useLegacyMixinAp.set(false) } // TODO: Add an extra shadow configuration for optimizable jars @@ -103,7 +92,6 @@ dependencies { shadowImpl("org.spongepowered:mixin:0.7.11-SNAPSHOT") { isTransitive = false } - annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT") shadowImpl("org.xerial:sqlite-jdbc:3.45.3.0") shadowImpl("org.notenoughupdates.moulconfig:legacy:3.0.0-beta.9") @@ -124,16 +112,6 @@ tasks.shadowJar { doFirst { error("Incorrect shadow JAR built!") } } -allprojects { - tasks.withType<Test> { - useJUnitPlatform() - } - - tasks.withType(JavaCompile::class) { - options.encoding = "UTF-8" - } -} - tasks.downloadRepo { hash.set("dcf1dbc") } @@ -148,7 +126,7 @@ sourceSets.main { java.srcDir(generateItemIds) } -tasks.withType(Jar::class) { +tasks.withType<Jar> { archiveBaseName.set(modid) manifest.attributes.run { this["FMLCorePluginContainsFMLMod"] = "true" @@ -169,8 +147,6 @@ tasks.processResources { filesMatching(listOf("mcmod.info", "mixins.$modid.json")) { expand(inputs.properties) } - - rename("(.+_at.cfg)", "META-INF/$1") } @@ -180,7 +156,6 @@ val proguard = tasks.register("proguard", ProGuardTask::class) { injars(tasks.jar.map { it.archiveFile }) outjars(proguardOutJar) configuration(file("ledger-rules.pro")) - verbose() val libJava = javaToolchains.launcherFor(java.toolchain) .get() .metadata.installationPath.file("jre/lib/rt.jar") @@ -210,10 +185,9 @@ val shadowJar2 = tasks.register("shadowJar2", ShadowJar::class) { "META-INF/versions/**" ) } -val remapJar by tasks.named<net.fabricmc.loom.task.RemapJarTask>("remapJar") { +tasks.remapJar { archiveClassifier.set("") - from(shadowJar2) - input.set(shadowJar2.get().archiveFile) + inputFile.set(shadowJar2.flatMap { it.archiveFile }) } tasks.jar { @@ -221,7 +195,6 @@ tasks.jar { destinationDirectory.set(layout.buildDirectory.dir("badjars")) } - tasks.assemble.get().dependsOn(tasks.remapJar) inline fun <reified T : Any> ExtensionAware.configureIf(crossinline block: T.() -> Unit) { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a80b22c..b82aa23 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle.kts b/settings.gradle.kts index 4c8cf26..ea25ef5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,10 +1,13 @@ pluginManagement { repositories { + maven("https://maven.fabricmc.net") + maven("https://jitpack.io") + mavenCentral() + google() mavenCentral() gradlePluginPortal() maven("https://oss.sonatype.org/content/repositories/snapshots") maven("https://maven.architectury.dev/") - maven("https://maven.fabricmc.net") maven("https://maven.minecraftforge.net/") maven("https://repo.spongepowered.org/maven/") maven("https://repo.sk1er.club/repository/maven-releases/") @@ -15,11 +18,10 @@ pluginManagement { "gg.essential.loom" -> useModule("gg.essential:architectury-loom:${requested.version}") } } - } -} + }} plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version ("0.6.0") + id("org.gradle.toolchains.foojay-resolver-convention") version ("0.8.0") } diff --git a/src/main/resources/mixins.moneyledger.json b/src/main/resources/mixins.moneyledger.json index 5ea0c57..fa6482e 100644 --- a/src/main/resources/mixins.moneyledger.json +++ b/src/main/resources/mixins.moneyledger.json @@ -1,7 +1,6 @@ { "package": "${basePackage}.mixin", "plugin": "${basePackage}.init.AutoDiscoveryMixinPlugin", - "refmap": "mixins.${modid}.refmap.json", "minVersion": "0.7", "compatibilityLevel": "JAVA_8", "__comment": "You do not need to manually register mixins in this template. Check the auto discovery mixin plugin for more info." |