mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Gradle 9.1 deprecation fixes + update test and build libs (#1338)
* Update test and build libs * Gradle deprecation fixes * RC4
This commit is contained in:
@@ -15,10 +15,10 @@ loom-native = "0.2.0"
|
||||
unpick = "3.0.0-beta.5"
|
||||
|
||||
# Plugins
|
||||
spotless = "6.25.0"
|
||||
test-retry = "1.5.6"
|
||||
checkstyle = "10.17.0"
|
||||
codenarc = "3.4.0"
|
||||
spotless = "7.2.1"
|
||||
test-retry = "1.6.2"
|
||||
checkstyle = "10.26.1"
|
||||
codenarc = "3.6.0"
|
||||
|
||||
[libraries]
|
||||
# Loom compile libraries
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
[versions]
|
||||
spock = "2.3-groovy-3.0"
|
||||
junit = "5.12.2"
|
||||
javalin = "6.6.0"
|
||||
mockito = "5.17.0"
|
||||
junit = "5.13.4"
|
||||
javalin = "6.7.0"
|
||||
mockito = "5.18.0"
|
||||
java-debug = "0.53.1"
|
||||
mixin = "0.15.3+mixin.0.8.7"
|
||||
bouncycastle = "1.80"
|
||||
bouncycastle = "1.81"
|
||||
|
||||
gradle-latest = "9.0.0-rc-1"
|
||||
gradle-nightly = "9.1.0-20250620001442+0000"
|
||||
gradle-latest = "9.0.0-rc-4"
|
||||
gradle-nightly = "9.1.0-20250729001554+0000"
|
||||
fabric-loader = "0.16.14"
|
||||
|
||||
[libraries]
|
||||
|
||||
@@ -166,18 +166,18 @@ public abstract class GenVsCodeProjectTask extends AbstractLoomTask {
|
||||
Path projectPath = project.getProjectDir().toPath();
|
||||
String relativeRunDir = rootPath.relativize(projectPath).resolve(runConfig.runDir).toString();
|
||||
return new VsCodeConfiguration(
|
||||
"java",
|
||||
runConfig.configName,
|
||||
"launch",
|
||||
"${workspaceFolder}/" + relativeRunDir,
|
||||
"integratedTerminal",
|
||||
false,
|
||||
runConfig.mainClass,
|
||||
RunConfig.joinArguments(runConfig.vmArgs),
|
||||
RunConfig.joinArguments(runConfig.programArgs),
|
||||
new HashMap<>(runConfig.environmentVariables),
|
||||
runConfig.projectName,
|
||||
rootPath.resolve(relativeRunDir).toAbsolutePath().toString()
|
||||
"java",
|
||||
runConfig.configName,
|
||||
"launch",
|
||||
"${workspaceFolder}/" + relativeRunDir,
|
||||
"integratedTerminal",
|
||||
false,
|
||||
runConfig.mainClass,
|
||||
RunConfig.joinArguments(runConfig.vmArgs),
|
||||
RunConfig.joinArguments(runConfig.programArgs),
|
||||
new HashMap<>(runConfig.environmentVariables),
|
||||
runConfig.projectName,
|
||||
rootPath.resolve(relativeRunDir).toAbsolutePath().toString()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Map;
|
||||
|
||||
import org.cadixdev.lorenz.MappingSet;
|
||||
import org.cadixdev.mercury.Mercury;
|
||||
@@ -174,7 +173,8 @@ public class MigrateMappingsService extends Service<MigrateMappingsService.Optio
|
||||
}
|
||||
} catch (IllegalDependencyNotation ignored) {
|
||||
LOGGER.info("Could not locate mappings, presuming V2 Yarn");
|
||||
return project.getConfigurations().detachedConfiguration(project.getDependencies().create(Map.of("group", "net.fabricmc", "name", "yarn", "version", mappings, "classifier", "v2")));
|
||||
String mavenNotation = "net.fabricmc:yarn:%s:v2".formatted(mappings);
|
||||
return project.getConfigurations().detachedConfiguration(project.getDependencies().create(mavenNotation));
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException("Failed to resolve mappings", e);
|
||||
}
|
||||
|
||||
@@ -36,8 +36,7 @@ class KotlinClassMetadataRemappingAnnotationVisitor(
|
||||
private val remapper: Remapper,
|
||||
val next: AnnotationVisitor,
|
||||
val className: String?,
|
||||
) :
|
||||
AnnotationNode(Opcodes.ASM9, KotlinMetadataRemappingClassVisitor.ANNOTATION_DESCRIPTOR) {
|
||||
) : AnnotationNode(Opcodes.ASM9, KotlinMetadataRemappingClassVisitor.ANNOTATION_DESCRIPTOR) {
|
||||
private val logger = LoggerFactory.getLogger(javaClass)
|
||||
|
||||
override fun visit(
|
||||
@@ -100,12 +99,13 @@ class KotlinClassMetadataRemappingAnnotationVisitor(
|
||||
var kpackage = metadata.kmPackage
|
||||
kpackage = KotlinClassRemapper(remapper).remap(kpackage)
|
||||
val remapped =
|
||||
KotlinClassMetadata.MultiFileClassPart(
|
||||
kpackage,
|
||||
metadata.facadeClassName,
|
||||
metadata.version,
|
||||
metadata.flags,
|
||||
).write()
|
||||
KotlinClassMetadata
|
||||
.MultiFileClassPart(
|
||||
kpackage,
|
||||
metadata.facadeClassName,
|
||||
metadata.version,
|
||||
metadata.flags,
|
||||
).write()
|
||||
writeClassHeader(remapped)
|
||||
validateKotlinClassHeader(remapped, header)
|
||||
}
|
||||
|
||||
@@ -55,7 +55,9 @@ import kotlin.metadata.jvm.syntheticMethodForDelegate
|
||||
import kotlin.metadata.jvm.toJvmInternalName
|
||||
|
||||
@OptIn(ExperimentalContextReceivers::class)
|
||||
class KotlinClassRemapper(private val remapper: Remapper) {
|
||||
class KotlinClassRemapper(
|
||||
private val remapper: Remapper,
|
||||
) {
|
||||
fun remap(clazz: KmClass): KmClass {
|
||||
clazz.name = remap(clazz.name)
|
||||
clazz.typeParameters.replaceAll(this::remap)
|
||||
@@ -154,13 +156,16 @@ class KotlinClassRemapper(private val remapper: Remapper) {
|
||||
return typeParameter
|
||||
}
|
||||
|
||||
private fun remap(typeProjection: KmTypeProjection): KmTypeProjection {
|
||||
return KmTypeProjection(typeProjection.variance, typeProjection.type?.let { remap(it) })
|
||||
}
|
||||
private fun remap(typeProjection: KmTypeProjection): KmTypeProjection =
|
||||
KmTypeProjection(
|
||||
typeProjection.variance,
|
||||
typeProjection.type?.let {
|
||||
remap(it)
|
||||
},
|
||||
)
|
||||
|
||||
private fun remap(flexibleTypeUpperBound: KmFlexibleTypeUpperBound): KmFlexibleTypeUpperBound {
|
||||
return KmFlexibleTypeUpperBound(remap(flexibleTypeUpperBound.type), flexibleTypeUpperBound.typeFlexibilityId)
|
||||
}
|
||||
private fun remap(flexibleTypeUpperBound: KmFlexibleTypeUpperBound): KmFlexibleTypeUpperBound =
|
||||
KmFlexibleTypeUpperBound(remap(flexibleTypeUpperBound.type), flexibleTypeUpperBound.typeFlexibilityId)
|
||||
|
||||
private fun remap(valueParameter: KmValueParameter): KmValueParameter {
|
||||
valueParameter.type = remap(valueParameter.type)
|
||||
@@ -168,15 +173,11 @@ class KotlinClassRemapper(private val remapper: Remapper) {
|
||||
return valueParameter
|
||||
}
|
||||
|
||||
private fun remap(annotation: KmAnnotation): KmAnnotation {
|
||||
return KmAnnotation(remap(annotation.className), annotation.arguments)
|
||||
}
|
||||
private fun remap(annotation: KmAnnotation): KmAnnotation = KmAnnotation(remap(annotation.className), annotation.arguments)
|
||||
|
||||
private fun remap(signature: JvmMethodSignature): JvmMethodSignature {
|
||||
return JvmMethodSignature(signature.name, remapper.mapMethodDesc(signature.descriptor))
|
||||
}
|
||||
private fun remap(signature: JvmMethodSignature): JvmMethodSignature =
|
||||
JvmMethodSignature(signature.name, remapper.mapMethodDesc(signature.descriptor))
|
||||
|
||||
private fun remap(signature: JvmFieldSignature): JvmFieldSignature {
|
||||
return JvmFieldSignature(signature.name, remapper.mapDesc(signature.descriptor))
|
||||
}
|
||||
private fun remap(signature: JvmFieldSignature): JvmFieldSignature =
|
||||
JvmFieldSignature(signature.name, remapper.mapDesc(signature.descriptor))
|
||||
}
|
||||
|
||||
@@ -31,7 +31,10 @@ import org.objectweb.asm.Opcodes
|
||||
import org.objectweb.asm.Type
|
||||
import org.objectweb.asm.commons.Remapper
|
||||
|
||||
class KotlinMetadataRemappingClassVisitor(private val remapper: Remapper, next: ClassVisitor?) : ClassVisitor(Opcodes.ASM9, next) {
|
||||
class KotlinMetadataRemappingClassVisitor(
|
||||
private val remapper: Remapper,
|
||||
next: ClassVisitor?,
|
||||
) : ClassVisitor(Opcodes.ASM9, next) {
|
||||
companion object {
|
||||
val ANNOTATION_DESCRIPTOR: String = Type.getDescriptor(Metadata::class.java)
|
||||
}
|
||||
@@ -68,7 +71,5 @@ class KotlinMetadataRemappingClassVisitor(private val remapper: Remapper, next:
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
fun getRuntimeKotlinVersion(): String {
|
||||
return KotlinVersion.CURRENT.toString()
|
||||
}
|
||||
fun getRuntimeKotlinVersion(): String = KotlinVersion.CURRENT.toString()
|
||||
}
|
||||
|
||||
@@ -33,9 +33,7 @@ object KotlinMetadataTinyRemapperExtensionImpl : KotlinMetadataTinyRemapperExten
|
||||
override fun insertApplyVisitor(
|
||||
cls: TrClass,
|
||||
next: ClassVisitor?,
|
||||
): ClassVisitor {
|
||||
return KotlinMetadataRemappingClassVisitor(cls.environment.remapper, next)
|
||||
}
|
||||
): ClassVisitor = KotlinMetadataRemappingClassVisitor(cls.environment.remapper, next)
|
||||
|
||||
override fun attach(builder: TinyRemapper.Builder) {
|
||||
builder.extraPreApplyVisitor(this)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.util.Properties
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "2.0.21"
|
||||
@@ -18,9 +18,9 @@ tasks {
|
||||
withType<JavaCompile> {
|
||||
options.release.set(8)
|
||||
}
|
||||
withType<KotlinCompile<KotlinJvmOptions>> {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
withType<KotlinCompile> {
|
||||
compilerOptions {
|
||||
jvmTarget = JvmTarget.JVM_1_8
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,10 +29,10 @@ group = "com.example"
|
||||
version = "0.0.1"
|
||||
|
||||
dependencies {
|
||||
minecraft(group = "com.mojang", name = "minecraft", version = "1.16.5")
|
||||
mappings(group = "net.fabricmc", name = "yarn", version = "1.16.5+build.5", classifier = "v2")
|
||||
minecraft("com.mojang:minecraft:1.16.5")
|
||||
mappings("net.fabricmc:yarn:1.16.5+build.5:v2")
|
||||
modImplementation("net.fabricmc:fabric-loader:0.16.9")
|
||||
modImplementation(group = "net.fabricmc", name = "fabric-language-kotlin", version = "1.12.3+kotlin.2.0.21")
|
||||
modImplementation("net.fabricmc:fabric-language-kotlin:1.12.3+kotlin.2.0.21")
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
||||
@@ -29,7 +29,7 @@ dependencies {
|
||||
// Local files
|
||||
modImplementation files("test-data-a.jar", "test-data-b.jar") // multiple files in a bare FileCollection
|
||||
modImplementation fileTree("myFileTree") // an entire file tree
|
||||
modImplementation name: "test-data-e" // a flatDir dependency
|
||||
modImplementation ":test-data-e" // a flatDir dependency
|
||||
|
||||
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
|
||||
// You may need to force-disable transitiveness on them.
|
||||
|
||||
Reference in New Issue
Block a user