11/*
22 * This file is part of Resourcify
3- * Copyright (C) 2023-2025 DeDiamondPro
3+ * Copyright (C) 2023-2026 DeDiamondPro
44 *
55 * This program is free software; you can redistribute it and/or
66 * modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,9 @@ import dev.dediamondpro.buildsource.Platform
2020import dev.dediamondpro.buildsource.VersionDefinition
2121import dev.dediamondpro.buildsource.VersionRange
2222import net.fabricmc.loom.task.RemapJarTask
23+ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
24+ import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
25+ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2326
2427plugins {
2528 alias(libs.plugins.kotlin)
@@ -76,7 +79,7 @@ val shadeModImplementation: Configuration by configurations.creating {
7679
7780// Version definitions
7881val mcVersion = VersionDefinition ( // Used for pre releases and release candidates
79- " 26.1" to " 26.1-pre -2" ,
82+ " 26.1" to " 26.1-rc -2" ,
8083 default = mcPlatform.versionString
8184)
8285val compatibleMcVersion = VersionDefinition (
@@ -89,7 +92,7 @@ val compatibleMcVersion = VersionDefinition(
8992 " 1.21.8" to VersionRange (" 1.21.6" , " 1.21.8" , name = " 1.21.8" ),
9093 " 1.21.10" to VersionRange (" 1.21.9" , " 1.21.10" , name = " 1.21.10" ),
9194 " 1.21.11" to VersionRange (" 1.21.11" , " 1.21.11" , name = " 1.21.11" ),
92- " 26.1" to VersionRange (" 26.1" , " 26.2" , inclusive = false , name = " 26.1" )
95+ " 26.1" to VersionRange (" 26.1" , " 26.2" , inclusive = false , name = " 26.1" , allowAll = true ) // TODO: remove allow all for final release
9396)
9497val javaVersion = VersionDefinition (
9598 " 1.20.1" to " 17" ,
@@ -169,7 +172,7 @@ dependencies {
169172
170173 if (mcPlatform.isFabric) {
171174 val modImpl = if (mcPlatform.isObfuscated) " modImplementation" else " implementation"
172- add(modImpl, " net.fabricmc:fabric-loader:0.17.3 " )
175+ add(modImpl, " net.fabricmc:fabric-loader:0.18.4 " )
173176 add(modImpl, " net.fabricmc:fabric-language-kotlin:${libs.versions.fabric.language.kotlin.get()} " )
174177 add(modImpl, " net.fabricmc.fabric-api:fabric-api:${fabricApiVersion.get(mcPlatform)} " )
175178 add(modImpl, " com.terraformersmc:modmenu:${modMenuVersion.get(mcPlatform)} " )
@@ -303,6 +306,7 @@ tasks {
303306 }
304307 } else {
305308 named(" shadowJar" ) { finalizedBy(" copyJar" ) }
309+ named<Jar >(" jar" ) { enabled = false }
306310 }
307311 register<Copy >(" copyJar" ) {
308312 File (" ${project.rootDir} /jars" ).mkdir()
@@ -330,7 +334,13 @@ tasks {
330334 if (! mcPlatform.isForgeLike) exclude(" pack.mcmeta" )
331335 if (! mcPlatform.isForge && (! mcPlatform.isNeoForge || mcPlatform.version >= 12005 )) exclude(" META-INF/mods.toml" )
332336 if (! mcPlatform.isNeoForge || mcPlatform.version < 12005 ) exclude(" META-INF/neoforge.mods.toml" )
333- if (mcPlatform.minor == 20 ) exclude(" 1.21.resourcify.accesswidener" ) else exclude(" 1.20.resourcify.accesswidener" )
337+ // Exclude all access wideners and mixin configs except the active ones
338+ listOf (" 1.20.resourcify" , " 1.21.resourcify" , " 1.21.9.resourcify" , " 26.1.resourcify" )
339+ .filter { it != accessWidener }
340+ .forEach { exclude(" $it .accesswidener" ) }
341+ listOf (" mixins.resourcify.json" , " mixins.resourcify-1.21.11.json" )
342+ .filter { it != mixinPath }
343+ .forEach { exclude(it) }
334344 }
335345 withType<Jar > {
336346 from(rootProject.file(" LICENSE" ))
@@ -341,3 +351,10 @@ tasks {
341351configure<JavaPluginExtension > {
342352 toolchain.languageVersion.set(JavaLanguageVersion .of(javaVersion.get(mcPlatform)))
343353}
354+
355+ tasks.withType<KotlinCompile >().configureEach {
356+ compilerOptions {
357+ jvmTarget.set(JvmTarget .fromTarget(javaVersion.get(mcPlatform)))
358+ apiVersion.set(KotlinVersion .KOTLIN_2_0 )
359+ }
360+ }
0 commit comments