diff --git a/fabric-loom b/fabric-loom index b7c8013..297b7f9 160000 --- a/fabric-loom +++ b/fabric-loom @@ -1 +1 @@ -Subproject commit b7c80133ce9e6f13ced8ee2634f2f62690eff2e9 +Subproject commit 297b7f90e94b0de7d7d1c594746d9c277cfadb84 diff --git a/patches/0001-Initial-Quiltification.patch b/patches/0001-Initial-Quiltification.patch index 1230a39..1c830e9 100644 --- a/patches/0001-Initial-Quiltification.patch +++ b/patches/0001-Initial-Quiltification.patch @@ -13,7 +13,7 @@ This includes: - Adding Vineflower and using it by default diff --git a/build.gradle b/build.gradle -index 014f8da9a6d07b509d938de7c6090c1b3b8de573..6df36c1184b3ee5581c68bb46d3004adc308b1ef 100644 +index de84c29f..32442f2a 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { @@ -22,10 +22,10 @@ index 014f8da9a6d07b509d938de7c6090c1b3b8de573..6df36c1184b3ee5581c68bb46d3004ad -group = 'net.fabricmc' +group = 'org.quiltmc' - def baseVersion = '1.4' + def baseVersion = '1.5' def ENV = System.getenv() -@@ -251,10 +251,16 @@ codenarc { +@@ -252,10 +252,16 @@ codenarc { gradlePlugin { plugins { @@ -44,7 +44,7 @@ index 014f8da9a6d07b509d938de7c6090c1b3b8de573..6df36c1184b3ee5581c68bb46d3004ad } } -@@ -311,8 +317,8 @@ publishing { +@@ -312,8 +318,8 @@ publishing { // Manually crate the plugin marker for snapshot versions snapshotPlugin(MavenPublication) { publication -> @@ -55,7 +55,7 @@ index 014f8da9a6d07b509d938de7c6090c1b3b8de573..6df36c1184b3ee5581c68bb46d3004ad version baseVersion + '-SNAPSHOT' pom.withXml({ -@@ -322,9 +328,9 @@ publishing { +@@ -323,9 +329,9 @@ publishing { Node dependencies = root.appendChild(document.createElement('dependencies')) Node dependency = dependencies.appendChild(document.createElement('dependency')) Node groupId = dependency.appendChild(document.createElement('groupId')) @@ -67,7 +67,7 @@ index 014f8da9a6d07b509d938de7c6090c1b3b8de573..6df36c1184b3ee5581c68bb46d3004ad Node version = dependency.appendChild(document.createElement('version')) version.setTextContent(baseVersion + '-SNAPSHOT') }) -@@ -332,6 +338,7 @@ publishing { +@@ -333,6 +339,7 @@ publishing { } repositories { maven { @@ -75,7 +75,7 @@ index 014f8da9a6d07b509d938de7c6090c1b3b8de573..6df36c1184b3ee5581c68bb46d3004ad if (ENV.MAVEN_URL) { url ENV.MAVEN_URL credentials { -@@ -340,6 +347,26 @@ publishing { +@@ -341,6 +348,26 @@ publishing { } } } @@ -103,7 +103,7 @@ index 014f8da9a6d07b509d938de7c6090c1b3b8de573..6df36c1184b3ee5581c68bb46d3004ad } diff --git a/gradle.properties b/gradle.properties -index 31014b156127886c44921900f480e68d4528da25..ee1d4c3083cdb729df09522e88a41351d332a875 100644 +index 31014b15..ee1d4c30 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ @@ -117,10 +117,10 @@ index 31014b156127886c44921900f480e68d4528da25..ee1d4c3083cdb729df09522e88a41351 kotlin.stdlib.default.dependency = false \ No newline at end of file diff --git a/src/main/java/net/fabricmc/loom/LoomGradlePlugin.java b/src/main/java/net/fabricmc/loom/LoomGradlePlugin.java -index 8231476d474a431b632ee75251dbc76e9212bc7f..98be8d15cac40265413e890bf9eca9acff017944 100644 +index 71248d2d..76a88fc5 100644 --- a/src/main/java/net/fabricmc/loom/LoomGradlePlugin.java +++ b/src/main/java/net/fabricmc/loom/LoomGradlePlugin.java -@@ -79,7 +79,7 @@ public class LoomGradlePlugin implements BootstrappedPlugin { +@@ -76,7 +76,7 @@ public class LoomGradlePlugin implements BootstrappedPlugin { } public void apply(Project project) { @@ -130,7 +130,7 @@ index 8231476d474a431b632ee75251dbc76e9212bc7f..98be8d15cac40265413e890bf9eca9ac // Apply default plugins diff --git a/src/main/java/net/fabricmc/loom/LoomRepositoryPlugin.java b/src/main/java/net/fabricmc/loom/LoomRepositoryPlugin.java -index 29b4a526050a69cb5ccaa2d067fa5ecaa0347bf0..dc4895d24e908cf5d041ae71ef17dac40e6c86bf 100644 +index 29b4a526..dc4895d2 100644 --- a/src/main/java/net/fabricmc/loom/LoomRepositoryPlugin.java +++ b/src/main/java/net/fabricmc/loom/LoomRepositoryPlugin.java @@ -67,7 +67,10 @@ public class LoomRepositoryPlugin implements Plugin { @@ -146,7 +146,7 @@ index 29b4a526050a69cb5ccaa2d067fa5ecaa0347bf0..dc4895d24e908cf5d041ae71ef17dac4 repo.setName("Mojang"); repo.setUrl(MirrorUtil.getLibrariesBase(target)); diff --git a/src/main/java/net/fabricmc/loom/configuration/LoomDependencyManager.java b/src/main/java/net/fabricmc/loom/configuration/LoomDependencyManager.java -index b41b39bf86c6bfcd8c600eb70d160d801e66f510..d9599c24f9b47d678277f0300b6b6f54ff1c9e2b 100644 +index b41b39bf..d9599c24 100644 --- a/src/main/java/net/fabricmc/loom/configuration/LoomDependencyManager.java +++ b/src/main/java/net/fabricmc/loom/configuration/LoomDependencyManager.java @@ -44,7 +44,7 @@ public class LoomDependencyManager { @@ -159,10 +159,10 @@ index b41b39bf86c6bfcd8c600eb70d160d801e66f510..d9599c24f9b47d678277f0300b6b6f54 } } diff --git a/src/main/java/net/fabricmc/loom/configuration/decompile/SingleJarDecompileConfiguration.java b/src/main/java/net/fabricmc/loom/configuration/decompile/SingleJarDecompileConfiguration.java -index 538c3018b085067e3d0e99d6fc8a0530b07cf6e9..9e4b9dbb1d8d837653fe4d1acebebfc22fed7bdb 100644 +index 6965a0bf..8d2f1807 100644 --- a/src/main/java/net/fabricmc/loom/configuration/decompile/SingleJarDecompileConfiguration.java +++ b/src/main/java/net/fabricmc/loom/configuration/decompile/SingleJarDecompileConfiguration.java -@@ -68,7 +68,7 @@ public class SingleJarDecompileConfiguration extends DecompileConfiguration getBooleanPropertyProvider(Project project, String key) { diff --git a/src/main/java/net/fabricmc/loom/util/service/BuildSharedServiceManager.java b/src/main/java/net/fabricmc/loom/util/service/BuildSharedServiceManager.java -index 6575611dea711ca1bb284a76132110404cdd95cb..b6f0ed542dc183f5782e300c57dce2c3ee3969b2 100644 +index 6575611d..b6f0ed54 100644 --- a/src/main/java/net/fabricmc/loom/util/service/BuildSharedServiceManager.java +++ b/src/main/java/net/fabricmc/loom/util/service/BuildSharedServiceManager.java @@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory; @@ -362,7 +362,7 @@ index 6575611dea711ca1bb284a76132110404cdd95cb..b6f0ed542dc183f5782e300c57dce2c3 private SharedServiceManager sharedServiceManager = new BuildSharedServiceManagerImpl(); private final AtomicInteger refCount = new AtomicInteger(0); diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/DecompileTest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/DecompileTest.groovy -index 7431aae09931a6e8656dfb801b9005feb0baa823..c755bb6bc8faa028b19392ce391adbb0cf10b05f 100644 +index 7431aae0..c755bb6b 100644 --- a/src/test/groovy/net/fabricmc/loom/test/integration/DecompileTest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/integration/DecompileTest.groovy @@ -46,6 +46,7 @@ class DecompileTest extends Specification implements GradleProjectTestTrait { @@ -374,7 +374,7 @@ index 7431aae09931a6e8656dfb801b9005feb0baa823..c755bb6bc8faa028b19392ce391adbb0 'cfr' | "genSourcesWithCfr" | PRE_RELEASE_GRADLE 'vineflower' | "genSourcesWithVineflower" | PRE_RELEASE_GRADLE diff --git a/src/test/groovy/net/fabricmc/loom/test/util/GradleProjectTestTrait.groovy b/src/test/groovy/net/fabricmc/loom/test/util/GradleProjectTestTrait.groovy -index 11e2a7070021ebd0fd9005b93151540c7c934b12..0ee3043e1a8429e37dca65e03f6e54498f3182f0 100644 +index 11e2a707..0ee3043e 100644 --- a/src/test/groovy/net/fabricmc/loom/test/util/GradleProjectTestTrait.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/util/GradleProjectTestTrait.groovy @@ -238,7 +238,7 @@ trait GradleProjectTestTrait { diff --git a/patches/0002-Exclude-Fabric-dependencies-replaced-by-Quilt.patch b/patches/0002-Exclude-Fabric-dependencies-replaced-by-Quilt.patch index 01b4ccb..100853c 100644 --- a/patches/0002-Exclude-Fabric-dependencies-replaced-by-Quilt.patch +++ b/patches/0002-Exclude-Fabric-dependencies-replaced-by-Quilt.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Exclude Fabric dependencies replaced by Quilt diff --git a/src/main/java/net/fabricmc/loom/configuration/InstallerData.java b/src/main/java/net/fabricmc/loom/configuration/InstallerData.java -index ce8da78d03c3bbcc19a9620c9d5d30fc8a058e7d..0d77a02472d055fab95613dbbd4e6dbaa08ea4f9 100644 +index ce8da78d..0d77a024 100644 --- a/src/main/java/net/fabricmc/loom/configuration/InstallerData.java +++ b/src/main/java/net/fabricmc/loom/configuration/InstallerData.java @@ -40,9 +40,8 @@ import net.fabricmc.loom.LoomRepositoryPlugin; @@ -20,20 +20,20 @@ index ce8da78d03c3bbcc19a9620c9d5d30fc8a058e7d..0d77a02472d055fab95613dbbd4e6dba LoomGradleExtension extension = LoomGradleExtension.get(project); diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java b/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java -index 7274912e12820e697991389626d5bda87ddd1162..2b95638caf9acc51353a994a24431a00e2f3c2ae 100644 +index c7e91aca..c1665d6e 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java -@@ -42,7 +42,8 @@ import net.fabricmc.loom.util.FileSystemUtil; +@@ -44,7 +44,8 @@ import net.fabricmc.loom.util.FileSystemUtil; import net.fabricmc.loom.util.fmj.FabricModJsonFactory; - public record ArtifactMetadata(boolean isFabricMod, RemapRequirements remapRequirements, @Nullable InstallerData installerData) { + public record ArtifactMetadata(boolean isFabricMod, RemapRequirements remapRequirements, @Nullable InstallerData installerData, MixinRemapType mixinRemapType) { - private static final String INSTALLER_PATH = "quilt_installer.json"; + private static final String QUILT_INSTALLER_PATH = "quilt_installer.json"; + private static final String FABRIC_INSTALLER_PATH = "fabric-installer.json"; - private static final String MANIFEST_PATH = "META-INF/MANIFEST.MF"; - private static final String MANIFEST_REMAP_KEY = "Fabric-Loom-Remap"; -@@ -66,11 +67,17 @@ public record ArtifactMetadata(boolean isFabricMod, RemapRequirements remapRequi + public static ArtifactMetadata create(ArtifactRef artifact, String currentLoomVersion) throws IOException { + boolean isFabricMod; +@@ -81,11 +82,17 @@ public record ArtifactMetadata(boolean isFabricMod, RemapRequirements remapRequi } } @@ -54,12 +54,12 @@ index 7274912e12820e697991389626d5bda87ddd1162..2b95638caf9acc51353a994a24431a00 } diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/ModConfigurationRemapper.java b/src/main/java/net/fabricmc/loom/configuration/mods/ModConfigurationRemapper.java -index 7ff0fbc78dc242a82a925ca72dd85168116aa115..86316049c4c17f9362ab3a10cb25489d29a05229 100644 +index 61a4d844..2cd92134 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/ModConfigurationRemapper.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/ModConfigurationRemapper.java -@@ -31,12 +31,20 @@ import java.nio.file.Files; - import java.nio.file.Path; +@@ -32,12 +32,20 @@ import java.nio.file.Path; import java.util.ArrayList; + import java.util.Comparator; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedHashMap; @@ -78,7 +78,7 @@ index 7ff0fbc78dc242a82a925ca72dd85168116aa115..86316049c4c17f9362ab3a10cb25489d import org.gradle.api.Project; import org.gradle.api.artifacts.Configuration; import org.gradle.api.artifacts.FileCollectionDependency; -@@ -59,7 +67,6 @@ import net.fabricmc.loom.LoomGradleExtension; +@@ -61,7 +69,6 @@ import net.fabricmc.loom.LoomGradlePlugin; import net.fabricmc.loom.api.RemapConfigurationSettings; import net.fabricmc.loom.configuration.RemapConfigurations; import net.fabricmc.loom.configuration.mods.dependency.ModDependency; @@ -86,7 +86,7 @@ index 7ff0fbc78dc242a82a925ca72dd85168116aa115..86316049c4c17f9362ab3a10cb25489d import net.fabricmc.loom.configuration.providers.minecraft.MinecraftSourceSets; import net.fabricmc.loom.util.Checksum; import net.fabricmc.loom.util.Constants; -@@ -121,19 +128,22 @@ public class ModConfigurationRemapper { +@@ -133,20 +140,21 @@ public class ModConfigurationRemapper { } // Round 1: Discovery @@ -95,8 +95,6 @@ index 7ff0fbc78dc242a82a925ca72dd85168116aa115..86316049c4c17f9362ab3a10cb25489d + // Go through all the configs and find the installer data and QSL. + // The installer data has to be added before // any mods are remapped since remapping needs the dependencies provided by that data. -+ // The presence of Quilt Loader/QSL will be used to exclude the Fabric equivalents if needed. -+ final Map> dependenciesBySourceConfig = new HashMap<>(); + final Map> artifactsBySourceConfig = new HashMap<>(); + final Set sourceConfigsWithQsl = new HashSet<>(); @@ -104,6 +102,7 @@ index 7ff0fbc78dc242a82a925ca72dd85168116aa115..86316049c4c17f9362ab3a10cb25489d + AtomicReference installer = new AtomicReference<>(); + AtomicReference installerConfigToApply = new AtomicReference<>(); + AtomicReference installerArtifactToApply = new AtomicReference<>(); + final Map metaCache = new HashMap<>(); configsToRemap.forEach((sourceConfig, remappedConfig) -> { - /* - sourceConfig - The source configuration where the intermediary named artifacts come from. i.e "modApi" @@ -117,9 +116,9 @@ index 7ff0fbc78dc242a82a925ca72dd85168116aa115..86316049c4c17f9362ab3a10cb25489d + for (ArtifactRef artifact : artifacts) { final ArtifactMetadata artifactMetadata; - try { -@@ -143,21 +153,75 @@ public class ModConfigurationRemapper { - } + artifactMetadata = metaCache.computeIfAbsent(artifact, a -> { +@@ -158,21 +166,84 @@ public class ModConfigurationRemapper { + }); if (artifactMetadata.installerData() != null) { - if (extension.getInstallerData() != null) { @@ -195,11 +194,20 @@ index 7ff0fbc78dc242a82a925ca72dd85168116aa115..86316049c4c17f9362ab3a10cb25489d + } else if (sourceConfigsWithQsl.contains(sourceConfig) && artifact.group().equals("net.fabricmc.fabric-api")) { + continue; + } - final ModDependency modDependency = ModDependencyFactory.create(artifact, remappedConfig, clientRemappedConfig, mappingsSuffix, project); ++ final ArtifactMetadata artifactMetadata; ++ ++ artifactMetadata = metaCache.computeIfAbsent(artifact, a -> { ++ try { ++ return ArtifactMetadata.create(a, LoomGradlePlugin.LOOM_VERSION); ++ } catch (IOException e) { ++ throw ExceptionUtil.createDescriptiveWrapper(UncheckedIOException::new, "Failed to read metadata from " + a.path(), e); ++ } ++ }); + final ModDependency modDependency = ModDependencyFactory.create(artifact, artifactMetadata, remappedConfig, clientRemappedConfig, mappingsSuffix, project); scheduleSourcesRemapping(project, sourceRemapper, modDependency); modDependencies.add(modDependency); diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/MavenProjectTest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/MavenProjectTest.groovy -index 1a546c22e8ee8d4c56f9dd346a89b319402bbb2c..b56f85b7a4674b652b5bfc2c9ddf8d2daeec3a1d 100644 +index 1a546c22..b56f85b7 100644 --- a/src/test/groovy/net/fabricmc/loom/test/integration/MavenProjectTest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/integration/MavenProjectTest.groovy @@ -46,6 +46,7 @@ class MavenProjectTest extends Specification implements MockMavenServerTrait, Gr @@ -219,7 +227,7 @@ index 1a546c22e8ee8d4c56f9dd346a89b319402bbb2c..b56f85b7a4674b652b5bfc2c9ddf8d2d when: diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/MultiProjectTest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/MultiProjectTest.groovy -index da86621384189424e7a03ba0a9d6e3dcddc64e51..1f102b9348d343e6333d15dbfe4ba89c12042887 100644 +index c5669df0..18e060e5 100644 --- a/src/test/groovy/net/fabricmc/loom/test/integration/MultiProjectTest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/integration/MultiProjectTest.groovy @@ -29,6 +29,7 @@ import spock.lang.Unroll diff --git a/patches/0003-Support-QMJ.patch b/patches/0003-Support-QMJ.patch index bb220cf..b30c4f9 100644 --- a/patches/0003-Support-QMJ.patch +++ b/patches/0003-Support-QMJ.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Support QMJ diff --git a/src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java b/src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java -index 78584e11079ec0bb5000f5441ad159b65ed22b76..cfea29e66d4c9c266dbf87824b848446f36133b6 100644 +index 6570178e..bfc88584 100644 --- a/src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java +++ b/src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java -@@ -144,10 +144,10 @@ public interface LoomGradleExtensionAPI { +@@ -147,10 +147,10 @@ public interface LoomGradleExtensionAPI { void disableDeprecatedPomGeneration(MavenPublication publication); /** @@ -24,7 +24,7 @@ index 78584e11079ec0bb5000f5441ad159b65ed22b76..cfea29e66d4c9c266dbf87824b848446 diff --git a/src/main/java/net/fabricmc/loom/api/metadata/ModJson.java b/src/main/java/net/fabricmc/loom/api/metadata/ModJson.java new file mode 100644 -index 0000000000000000000000000000000000000000..ba3ae3d91cc89b63342d2dda5e373db409a477bc +index 00000000..ba3ae3d9 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/api/metadata/ModJson.java @@ -0,0 +1,58 @@ @@ -87,7 +87,7 @@ index 0000000000000000000000000000000000000000..ba3ae3d91cc89b63342d2dda5e373db4 + JsonObject addNestedJars(JsonObject json, List files); +} diff --git a/src/main/java/net/fabricmc/loom/api/processor/SpecContext.java b/src/main/java/net/fabricmc/loom/api/processor/SpecContext.java -index e0480168c7231e6a3ab09dd1d1e0beccc679c9a3..af78c5ee1cb008ad7a08a66291555413c2027779 100644 +index e0480168..af78c5ee 100644 --- a/src/main/java/net/fabricmc/loom/api/processor/SpecContext.java +++ b/src/main/java/net/fabricmc/loom/api/processor/SpecContext.java @@ -27,17 +27,17 @@ package net.fabricmc.loom.api.processor; @@ -114,7 +114,7 @@ index e0480168c7231e6a3ab09dd1d1e0beccc679c9a3..af78c5ee1cb008ad7a08a66291555413 } } diff --git a/src/main/java/net/fabricmc/loom/build/nesting/IncludedJarFactory.java b/src/main/java/net/fabricmc/loom/build/nesting/IncludedJarFactory.java -index 925f5a7cb85c89f9596dd3de078c6d61d384595f..d3c818cbbe8e03b86427f4757a905e93ebc64d5d 100644 +index 3cf13e03..fbb2a7dd 100644 --- a/src/main/java/net/fabricmc/loom/build/nesting/IncludedJarFactory.java +++ b/src/main/java/net/fabricmc/loom/build/nesting/IncludedJarFactory.java @@ -52,9 +52,9 @@ import org.jetbrains.annotations.Nullable; @@ -137,8 +137,17 @@ index 925f5a7cb85c89f9596dd3de078c6d61d384595f..d3c818cbbe8e03b86427f4757a905e93 // Input is a mod, nothing needs to be done. return input; } +@@ -158,7 +158,7 @@ public final class IncludedJarFactory { + + File tempFile = new File(tempDir, input.getName()); + +- if (tempFile.exists() && FabricModJsonFactory.isModJar(tempFile)) { ++ if (tempFile.exists() && ModMetadataHelper.isModJar(tempFile)) { + return tempFile; + } + diff --git a/src/main/java/net/fabricmc/loom/build/nesting/JarNester.java b/src/main/java/net/fabricmc/loom/build/nesting/JarNester.java -index e495d6a8351132b1e8b89a7f20b3ecc60f7f8d7f..b8754bba15be33c5ecc1b0837d923d445cef8e38 100644 +index e495d6a8..b8754bba 100644 --- a/src/main/java/net/fabricmc/loom/build/nesting/JarNester.java +++ b/src/main/java/net/fabricmc/loom/build/nesting/JarNester.java @@ -27,20 +27,21 @@ package net.fabricmc.loom.build.nesting; @@ -224,7 +233,7 @@ index e495d6a8351132b1e8b89a7f20b3ecc60f7f8d7f..b8754bba15be33c5ecc1b0837d923d44 throw new java.io.UncheckedIOException("Failed to nest jars into " + modJar.getName(), e); } diff --git a/src/main/java/net/fabricmc/loom/configuration/FileDependencyInfo.java b/src/main/java/net/fabricmc/loom/configuration/FileDependencyInfo.java -index 2f55bbe07081c750763d9351c6ff8fa9c575f787..232dca4e3aeb1269061c87e41cf152daa608022d 100644 +index 2f55bbe0..232dca4e 100644 --- a/src/main/java/net/fabricmc/loom/configuration/FileDependencyInfo.java +++ b/src/main/java/net/fabricmc/loom/configuration/FileDependencyInfo.java @@ -25,9 +25,6 @@ @@ -309,7 +318,7 @@ index 2f55bbe07081c750763d9351c6ff8fa9c575f787..232dca4e3aeb1269061c87e41cf152da } } diff --git a/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerEntry.java b/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerEntry.java -index 802b7c85bf1a58fbf1d2cf3575ee55d388323999..b32424ddcfe807de8e47ddb908e71dc01cec0c82 100644 +index 802b7c85..b32424dd 100644 --- a/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerEntry.java +++ b/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerEntry.java @@ -29,8 +29,8 @@ import java.io.IOException; @@ -323,7 +332,7 @@ index 802b7c85bf1a58fbf1d2cf3575ee55d388323999..b32424ddcfe807de8e47ddb908e71dc0 public interface AccessWidenerEntry { diff --git a/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerFile.java b/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerFile.java -index 72c39b417441a0fbb590cb19c30c0911a2737333..d0ea700d17f3e3e829ee0759007c14cad20faea0 100644 +index 72c39b41..d0ea700d 100644 --- a/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerFile.java +++ b/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerFile.java @@ -24,63 +24,14 @@ @@ -391,7 +400,7 @@ index 72c39b417441a0fbb590cb19c30c0911a2737333..d0ea700d17f3e3e829ee0759007c14ca public int hashCode() { int result = Objects.hash(path, modId); diff --git a/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerJarProcessor.java b/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerJarProcessor.java -index 212ef9328c791e2e1d0f740e99c4fcc055c7d299..53ea4c36cf56fd75ff95920a7cec32e9ee11f515 100644 +index 212ef932..53ea4c36 100644 --- a/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerJarProcessor.java +++ b/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerJarProcessor.java @@ -40,12 +40,12 @@ import org.jetbrains.annotations.Nullable; @@ -421,7 +430,7 @@ index 212ef9328c791e2e1d0f740e99c4fcc055c7d299..53ea4c36cf56fd75ff95920a7cec32e9 } diff --git a/src/main/java/net/fabricmc/loom/configuration/accesswidener/LocalAccessWidenerEntry.java b/src/main/java/net/fabricmc/loom/configuration/accesswidener/LocalAccessWidenerEntry.java -index 3d51e3e71a986fb47d70809a523cf5a627700de3..bde8414d043d1fa82478a90bddda0829b0fb2438 100644 +index 3d51e3e7..bde8414d 100644 --- a/src/main/java/net/fabricmc/loom/configuration/accesswidener/LocalAccessWidenerEntry.java +++ b/src/main/java/net/fabricmc/loom/configuration/accesswidener/LocalAccessWidenerEntry.java @@ -33,9 +33,9 @@ import org.jetbrains.annotations.Nullable; @@ -436,7 +445,7 @@ index 3d51e3e71a986fb47d70809a523cf5a627700de3..bde8414d043d1fa82478a90bddda0829 public record LocalAccessWidenerEntry(Path path, String hash) implements AccessWidenerEntry { diff --git a/src/main/java/net/fabricmc/loom/configuration/accesswidener/ModAccessWidenerEntry.java b/src/main/java/net/fabricmc/loom/configuration/accesswidener/ModAccessWidenerEntry.java -index 4731422ca79b2b0032090034d71305749a579675..b23f0e55b906b06d6df4561e4006565c9a9ff0ec 100644 +index 4731422c..b23f0e55 100644 --- a/src/main/java/net/fabricmc/loom/configuration/accesswidener/ModAccessWidenerEntry.java +++ b/src/main/java/net/fabricmc/loom/configuration/accesswidener/ModAccessWidenerEntry.java @@ -37,16 +37,17 @@ import net.fabricmc.accesswidener.AccessWidenerRemapper; @@ -461,7 +470,7 @@ index 4731422ca79b2b0032090034d71305749a579675..b23f0e55b906b06d6df4561e4006565c for (Map.Entry entry : modJson.getClassTweakers().entrySet()) { diff --git a/src/main/java/net/fabricmc/loom/configuration/ifaceinject/InterfaceInjectionProcessor.java b/src/main/java/net/fabricmc/loom/configuration/ifaceinject/InterfaceInjectionProcessor.java -index 98a4a79811dd43e5818bf618d47a67bfec9f3080..5c48e46f39d4868a4cef34f8bf17e0c1841301fe 100644 +index 98a4a798..5c48e46f 100644 --- a/src/main/java/net/fabricmc/loom/configuration/ifaceinject/InterfaceInjectionProcessor.java +++ b/src/main/java/net/fabricmc/loom/configuration/ifaceinject/InterfaceInjectionProcessor.java @@ -50,13 +50,13 @@ import org.slf4j.Logger; @@ -507,7 +516,7 @@ diff --git a/src/main/java/net/fabricmc/loom/util/fmj/ModEnvironment.java b/src/ similarity index 97% rename from src/main/java/net/fabricmc/loom/util/fmj/ModEnvironment.java rename to src/main/java/net/fabricmc/loom/configuration/metadata/ModEnvironment.java -index aaa5316951acae21a74c5725ab77b4e95703f6b7..d1faad3542974895bee6147a1c2cbe2e1561ad3e 100644 +index aaa53169..d1faad35 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/ModEnvironment.java +++ b/src/main/java/net/fabricmc/loom/configuration/metadata/ModEnvironment.java @@ -22,7 +22,7 @@ @@ -523,7 +532,7 @@ diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonHelpers.java similarity index 60% rename from src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonHelpers.java rename to src/main/java/net/fabricmc/loom/configuration/metadata/ModMetadataHelper.java -index 923c7a30d4d9785dbf26ef3f59f044197a53abe1..490240ac688d7fddba464b70005d7c236265c9b2 100644 +index 923c7a30..490240ac 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonHelpers.java +++ b/src/main/java/net/fabricmc/loom/configuration/metadata/ModMetadataHelper.java @@ -22,10 +22,13 @@ @@ -602,7 +611,7 @@ index 923c7a30d4d9785dbf26ef3f59f044197a53abe1..490240ac688d7fddba464b70005d7c23 + } } diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/AccessWidenerUtils.java b/src/main/java/net/fabricmc/loom/configuration/mods/AccessWidenerUtils.java -index 725e4fb11c74c5bfb884c4fb62839f74c8ecfc26..7c390f3c94ada509babd1e53b4bf26754c7b51cc 100644 +index 725e4fb1..7c390f3c 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/AccessWidenerUtils.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/AccessWidenerUtils.java @@ -28,14 +28,16 @@ import java.io.IOException; @@ -652,33 +661,33 @@ index 725e4fb11c74c5bfb884c4fb62839f74c8ecfc26..7c390f3c94ada509babd1e53b4bf2675 return new AccessWidenerData(accessWidenerPath, header, accessWidener); diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java b/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java -index 2b95638caf9acc51353a994a24431a00e2f3c2ae..536f13bce74690e3a207bd33ec29853ab0480f23 100644 +index c1665d6e..6f3c304b 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java -@@ -38,8 +38,8 @@ import org.jetbrains.annotations.Nullable; - +@@ -40,8 +40,8 @@ import org.jetbrains.annotations.Nullable; import net.fabricmc.loom.LoomGradlePlugin; import net.fabricmc.loom.configuration.InstallerData; + import net.fabricmc.loom.util.Constants; +import net.fabricmc.loom.configuration.metadata.ModMetadataHelper; import net.fabricmc.loom.util.FileSystemUtil; -import net.fabricmc.loom.util.fmj.FabricModJsonFactory; - public record ArtifactMetadata(boolean isFabricMod, RemapRequirements remapRequirements, @Nullable InstallerData installerData) { + public record ArtifactMetadata(boolean isFabricMod, RemapRequirements remapRequirements, @Nullable InstallerData installerData, MixinRemapType mixinRemapType) { private static final String QUILT_INSTALLER_PATH = "quilt_installer.json"; -@@ -53,7 +53,7 @@ public record ArtifactMetadata(boolean isFabricMod, RemapRequirements remapRequi - InstallerData installerData = null; +@@ -54,7 +54,7 @@ public record ArtifactMetadata(boolean isFabricMod, RemapRequirements remapRequi + MixinRemapType refmapRemapType = MixinRemapType.MIXIN; try (FileSystemUtil.Delegate fs = FileSystemUtil.getJarFileSystem(artifact.path())) { - isFabricMod = FabricModJsonFactory.containsMod(fs); + isFabricMod = ModMetadataHelper.containsMod(fs); - final Path manifestPath = fs.getPath(MANIFEST_PATH); + final Path manifestPath = fs.getPath(Constants.Manifest.PATH); if (Files.exists(manifestPath)) { diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/ModConfigurationRemapper.java b/src/main/java/net/fabricmc/loom/configuration/mods/ModConfigurationRemapper.java -index 86316049c4c17f9362ab3a10cb25489d29a05229..04b0ede63d0f2058f0d84ac8db2ae5ed72512571 100644 +index 2cd92134..c3a6949a 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/ModConfigurationRemapper.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/ModConfigurationRemapper.java -@@ -40,11 +40,6 @@ import java.util.concurrent.atomic.AtomicReference; +@@ -41,11 +41,6 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; import com.google.common.collect.ImmutableMap; @@ -690,9 +699,9 @@ index 86316049c4c17f9362ab3a10cb25489d29a05229..04b0ede63d0f2058f0d84ac8db2ae5ed import org.gradle.api.Project; import org.gradle.api.artifacts.Configuration; import org.gradle.api.artifacts.FileCollectionDependency; -@@ -65,8 +60,10 @@ import org.jetbrains.annotations.Nullable; - +@@ -67,8 +62,10 @@ import org.jetbrains.annotations.Nullable; import net.fabricmc.loom.LoomGradleExtension; + import net.fabricmc.loom.LoomGradlePlugin; import net.fabricmc.loom.api.RemapConfigurationSettings; +import net.fabricmc.loom.configuration.InstallerData; import net.fabricmc.loom.configuration.RemapConfigurations; @@ -701,7 +710,7 @@ index 86316049c4c17f9362ab3a10cb25489d29a05229..04b0ede63d0f2058f0d84ac8db2ae5ed import net.fabricmc.loom.configuration.providers.minecraft.MinecraftSourceSets; import net.fabricmc.loom.util.Checksum; import net.fabricmc.loom.util.Constants; -@@ -190,14 +187,14 @@ public class ModConfigurationRemapper { +@@ -203,14 +200,14 @@ public class ModConfigurationRemapper { if (installer.get() != null) { project.getLogger().info("Applying installer data"); @@ -721,27 +730,19 @@ index 86316049c4c17f9362ab3a10cb25489d29a05229..04b0ede63d0f2058f0d84ac8db2ae5ed installerArtifactToApply.get().applyToConfiguration(project, installerConfigToApply.get()); } installer.get().installerData().applyToProject(project); -@@ -222,6 +219,7 @@ public class ModConfigurationRemapper { - } else if (sourceConfigsWithQsl.contains(sourceConfig) && artifact.group().equals("net.fabricmc.fabric-api")) { - continue; - } -+ - final ModDependency modDependency = ModDependencyFactory.create(artifact, remappedConfig, clientRemappedConfig, mappingsSuffix, project); - scheduleSourcesRemapping(project, sourceRemapper, modDependency); - modDependencies.add(modDependency); diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/ModProcessor.java b/src/main/java/net/fabricmc/loom/configuration/mods/ModProcessor.java -index 3ed36eef9786d0c89a45d5552d05be292425cee8..bfd83ec633a254ebc2aa1a05f7ffa88dadbb3e1a 100644 +index 83c4bc7e..fd42f5c9 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/ModProcessor.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/ModProcessor.java -@@ -47,6 +47,7 @@ import org.gradle.api.attributes.Usage; +@@ -49,6 +49,7 @@ import org.gradle.api.attributes.Usage; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.api.RemapConfigurationSettings; import net.fabricmc.loom.api.mappings.layered.MappingsNamespace; +import net.fabricmc.loom.configuration.metadata.ModMetadataHelper; import net.fabricmc.loom.configuration.mods.dependency.ModDependency; import net.fabricmc.loom.configuration.providers.mappings.MappingConfiguration; - import net.fabricmc.loom.task.RemapJarTask; -@@ -56,6 +57,7 @@ import net.fabricmc.loom.util.TinyRemapperHelper; + import net.fabricmc.loom.extension.RemapperExtensionHolder; +@@ -58,6 +59,7 @@ import net.fabricmc.loom.util.TinyRemapperHelper; import net.fabricmc.loom.util.ZipUtils; import net.fabricmc.loom.util.kotlin.KotlinClasspathService; import net.fabricmc.loom.util.kotlin.KotlinRemapperClassloader; @@ -749,7 +750,7 @@ index 3ed36eef9786d0c89a45d5552d05be292425cee8..bfd83ec633a254ebc2aa1a05f7ffa88d import net.fabricmc.loom.util.service.SharedServiceManager; import net.fabricmc.tinyremapper.InputTag; import net.fabricmc.tinyremapper.NonClassCopyMode; -@@ -117,10 +119,7 @@ public class ModProcessor { +@@ -120,10 +122,7 @@ public class ModProcessor { private void stripNestedJars(Path path) { // Strip out all contained jar info as we dont want loader to try and load the jars contained in dev. try { @@ -762,7 +763,7 @@ index 3ed36eef9786d0c89a45d5552d05be292425cee8..bfd83ec633a254ebc2aa1a05f7ffa88d throw new UncheckedIOException("Failed to strip nested jars from %s".formatted(path), e); } diff --git a/src/main/java/net/fabricmc/loom/configuration/processors/ModJavadocProcessor.java b/src/main/java/net/fabricmc/loom/configuration/processors/ModJavadocProcessor.java -index 781ca37f2c763de0acbcb9254792052289ed00f9..ffdef6f8a9d6ae671c65a0068ec04426310e0474 100644 +index 781ca37f..ffdef6f8 100644 --- a/src/main/java/net/fabricmc/loom/configuration/processors/ModJavadocProcessor.java +++ b/src/main/java/net/fabricmc/loom/configuration/processors/ModJavadocProcessor.java @@ -38,18 +38,16 @@ import java.util.Objects; @@ -823,10 +824,10 @@ index 781ca37f2c763de0acbcb9254792052289ed00f9..ffdef6f8a9d6ae671c65a0068ec04426 try (Reader reader = new InputStreamReader(new ByteArrayInputStream(data))) { diff --git a/src/main/java/net/fabricmc/loom/configuration/processors/SpecContextImpl.java b/src/main/java/net/fabricmc/loom/configuration/processors/SpecContextImpl.java -index 622a0a1c6766aed0f526019e7cf09b5042ed8bac..2fa93c71cfa380874ac6a7107b461d2a63f97e9e 100644 +index 97e96a47..d6dd9c50 100644 --- a/src/main/java/net/fabricmc/loom/configuration/processors/SpecContextImpl.java +++ b/src/main/java/net/fabricmc/loom/configuration/processors/SpecContextImpl.java -@@ -43,36 +43,36 @@ import org.gradle.api.plugins.JavaPlugin; +@@ -45,41 +45,41 @@ import org.gradle.api.plugins.JavaPlugin; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.api.RemapConfigurationSettings; @@ -848,13 +849,15 @@ index 622a0a1c6766aed0f526019e7cf09b5042ed8bac..2fa93c71cfa380874ac6a7107b461d2a -public record SpecContextImpl(List modDependencies, List localMods, List compileRuntimeMods) implements SpecContext { +public record SpecContextImpl(List modDependencies, List localMods, List compileRuntimeMods) implements SpecContext { public static SpecContextImpl create(Project project) { -- return new SpecContextImpl(getDependentMods(project), FabricModJsonHelpers.getModsInProject(project), getCompileRuntimeMods(project)); -+ return new SpecContextImpl(getDependentMods(project), ModMetadataHelper.getModsInProject(project), getCompileRuntimeMods(project)); +- final Map> fmjCache = new HashMap<>(); +- return new SpecContextImpl(getDependentMods(project, fmjCache), FabricModJsonHelpers.getModsInProject(project), getCompileRuntimeMods(project, fmjCache)); ++ final Map> fmjCache = new HashMap<>(); ++ return new SpecContextImpl(getDependentMods(project, fmjCache), ModMetadataHelper.getModsInProject(project), getCompileRuntimeMods(project, fmjCache)); } // Reruns a list of mods found on both the compile and/or runtime classpaths -- private static List getDependentMods(Project project) { -+ private static List getDependentMods(Project project) { +- private static List getDependentMods(Project project, Map> fmjCache) { ++ private static List getDependentMods(Project project, Map> fmjCache) { final LoomGradleExtension extension = LoomGradleExtension.get(project); - var mods = new ArrayList(); + var mods = new ArrayList(); @@ -863,62 +866,74 @@ index 622a0a1c6766aed0f526019e7cf09b5042ed8bac..2fa93c71cfa380874ac6a7107b461d2a final Set artifacts = entry.getSourceConfiguration().get().resolve(); for (File artifact : artifacts) { -- final FabricModJson fabricModJson = FabricModJsonFactory.createFromZipNullable(artifact.toPath()); -+ final ModJson modJson = ModJsonFactory.createFromZipNullable(artifact.toPath()); - -- if (fabricModJson != null) { -- mods.add(fabricModJson); -+ if (modJson != null) { -+ mods.add(modJson); +- final List fabricModJson = fmjCache.computeIfAbsent(artifact.toPath().toAbsolutePath().toString(), $ -> { +- return FabricModJsonFactory.createFromZipOptional(artifact.toPath()) ++ final List modJson = fmjCache.computeIfAbsent(artifact.toPath().toAbsolutePath().toString(), $ -> { ++ return ModJsonFactory.createFromZipOptional(artifact.toPath()) + .map(List::of) + .orElseGet(List::of); + }); + +- if (!fabricModJson.isEmpty()) { +- mods.add(fabricModJson.get(0)); ++ if (!modJson.isEmpty()) { ++ mods.add(modJson.get(0)); } } } -@@ -80,7 +80,7 @@ public record SpecContextImpl(List modDependencies, List modDependencies, List { +- return FabricModJsonHelpers.getModsInProject(dependentProject); ++ return ModMetadataHelper.getModsInProject(dependentProject); + })); } } - -@@ -96,18 +96,18 @@ public record SpecContextImpl(List modDependencies, List modDependencies, List getCompileRuntimeMods(Project project) { -+ private static List getCompileRuntimeMods(Project project) { - var mods = new ArrayList<>(getCompileRuntimeModsFromRemapConfigs(project).toList()); +- private static List getCompileRuntimeMods(Project project, Map> fmjCache) { ++ private static List getCompileRuntimeMods(Project project, Map> fmjCache) { + var mods = new ArrayList<>(getCompileRuntimeModsFromRemapConfigs(project, fmjCache).toList()); for (Project dependentProject : getCompileRuntimeProjectDependencies(project).toList()) { -- mods.addAll(FabricModJsonHelpers.getModsInProject(dependentProject)); -+ mods.addAll(ModMetadataHelper.getModsInProject(dependentProject)); + mods.addAll(fmjCache.computeIfAbsent(dependentProject.getPath(), $ -> { +- return FabricModJsonHelpers.getModsInProject(dependentProject); ++ return ModMetadataHelper.getModsInProject(dependentProject); + })); } - return Collections.unmodifiableList(mods); +@@ -118,7 +118,7 @@ public record SpecContextImpl(List modDependencies, List getCompileRuntimeModsFromRemapConfigs(Project project) { -+ private static Stream getCompileRuntimeModsFromRemapConfigs(Project project) { +- private static Stream getCompileRuntimeModsFromRemapConfigs(Project project, Map> fmjCache) { ++ private static Stream getCompileRuntimeModsFromRemapConfigs(Project project, Map> fmjCache) { final LoomGradleExtension extension = LoomGradleExtension.get(project); final List runtimeEntries = extension.getRuntimeRemapConfigurations().stream() .filter(settings -> settings.getApplyDependencyTransforms().get()) -@@ -118,10 +118,10 @@ public record SpecContextImpl(List modDependencies, List settings.getApplyDependencyTransforms().get()) +@@ -130,15 +130,15 @@ public record SpecContextImpl(List modDependencies, List { +- final List list = fmjCache.computeIfAbsent(zipPath.toAbsolutePath().toString(), $ -> { +- return FabricModJsonFactory.createFromZipOptional(zipPath) ++ final List list = fmjCache.computeIfAbsent(zipPath.toAbsolutePath().toString(), $ -> { ++ return ModJsonFactory.createFromZipOptional(zipPath) + .map(List::of) + .orElseGet(List::of); + }); + return list.isEmpty() ? null : list.get(0); + }) + .filter(Objects::nonNull) - .sorted(Comparator.comparing(FabricModJson::getId)); -+ .map(mod -> (ModJson) mod.get()) + .sorted(Comparator.comparing(ModJson::getId)); } private static Function> resolveArtifacts(Project project, boolean runtime) { -@@ -154,12 +154,12 @@ public record SpecContextImpl(List modDependencies, List modDependencies, List patternFilterable.include("fabric.mod.json")) -- .getSingleFile(); -+ var resources = project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets().getByName("main").getResources(); -+ var qmj = resources.matching(patternFilterable -> patternFilterable.include("quilt.mod.json")); -+ -+ if (!qmj.isEmpty()) { -+ return qmj.getSingleFile(); -+ } else { -+ return resources.matching(patternFilterable -> patternFilterable.include("fabric.mod.json")).getSingleFile(); -+ } - } - } +- return fabricModJson.getModVersion(); ++ return modJson.getModVersion(); + } catch (IOException e) { + throw new UncheckedIOException("Failed to read mod version from main sourceset.", e); + } diff --git a/src/main/java/net/fabricmc/loom/task/RemapJarTask.java b/src/main/java/net/fabricmc/loom/task/RemapJarTask.java -index 9639f3d18bb22c437bbb0d93ac025474adc0cf03..71ccb96214c455694fe9e824991b7cca0075cc1d 100644 +index 0948b353..2c2a35c4 100644 --- a/src/main/java/net/fabricmc/loom/task/RemapJarTask.java +++ b/src/main/java/net/fabricmc/loom/task/RemapJarTask.java -@@ -59,9 +59,9 @@ import net.fabricmc.accesswidener.AccessWidenerReader; +@@ -62,6 +62,7 @@ import net.fabricmc.accesswidener.AccessWidenerReader; import net.fabricmc.accesswidener.AccessWidenerRemapper; import net.fabricmc.accesswidener.AccessWidenerWriter; import net.fabricmc.loom.LoomGradleExtension; +import net.fabricmc.loom.api.metadata.ModJson; import net.fabricmc.loom.build.nesting.IncludedJarFactory; import net.fabricmc.loom.build.nesting.JarNester; --import net.fabricmc.loom.configuration.accesswidener.AccessWidenerFile; - import net.fabricmc.loom.extension.MixinExtension; - import net.fabricmc.loom.task.service.TinyRemapperService; - import net.fabricmc.loom.util.Constants; -@@ -69,8 +69,7 @@ import net.fabricmc.loom.util.ExceptionUtil; + import net.fabricmc.loom.configuration.accesswidener.AccessWidenerFile; +@@ -73,8 +74,7 @@ import net.fabricmc.loom.util.ExceptionUtil; import net.fabricmc.loom.util.Pair; import net.fabricmc.loom.util.SidedClassVisitor; import net.fabricmc.loom.util.ZipUtils; @@ -996,7 +1004,7 @@ index 9639f3d18bb22c437bbb0d93ac025474adc0cf03..71ccb96214c455694fe9e824991b7cca import net.fabricmc.loom.util.service.BuildSharedServiceManager; import net.fabricmc.loom.util.service.UnsafeWorkQueueHelper; import net.fabricmc.tinyremapper.OutputConsumerPath; -@@ -153,13 +152,14 @@ public abstract class RemapJarTask extends AbstractRemapJarTask { +@@ -163,13 +163,14 @@ public abstract class RemapJarTask extends AbstractRemapJarTask { final LoomGradleExtension extension = LoomGradleExtension.get(getProject()); final MixinExtension mixinExtension = extension.getMixin(); @@ -1014,10 +1022,10 @@ index 9639f3d18bb22c437bbb0d93ac025474adc0cf03..71ccb96214c455694fe9e824991b7cca for (SourceSet sourceSet : mixinExtension.getMixinSourceSets()) { MixinExtension.MixinInformationContainer container = Objects.requireNonNull( -@@ -265,16 +265,18 @@ public abstract class RemapJarTask extends AbstractRemapJarTask { - } +@@ -291,16 +292,18 @@ public abstract class RemapJarTask extends AbstractRemapJarTask { + return; + } - private void remapAccessWidener() throws IOException { - final AccessWidenerFile accessWidenerFile = AccessWidenerFile.fromModJar(inputFile); + final ModJson metadata = ModJsonFactory.createFromZipNullable(inputFile); @@ -1039,10 +1047,10 @@ index 9639f3d18bb22c437bbb0d93ac025474adc0cf03..71ccb96214c455694fe9e824991b7cca private byte[] remapAccessWidener(byte[] input) { diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJson.java b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJson.java -index 8356bfa7e79c4523d98533be51a3cc13fcc50bb6..7eb2e2bfb9e0d29d6c6244f872dc5cd432c016ac 100644 +index 617019cb..7de454be 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJson.java +++ b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJson.java -@@ -24,46 +24,68 @@ +@@ -24,50 +24,68 @@ package net.fabricmc.loom.util.fmj; @@ -1075,16 +1083,20 @@ index 8356bfa7e79c4523d98533be51a3cc13fcc50bb6..7eb2e2bfb9e0d29d6c6244f872dc5cd4 this.source = Objects.requireNonNull(source); } -- public abstract int getVersion(); -- + public abstract int getVersion(); + + @Override public String getId() { - return readString(jsonObject, "id"); + return ModMetadataUtils.readString(jsonObject, "id"); } -+ public abstract int getVersion(); -+ ++ @Override + public String getModVersion() { +- return readString(jsonObject, "version"); ++ return ModMetadataUtils.readString(jsonObject, "version"); + } + @Nullable public abstract JsonElement getCustom(String key); @@ -1099,11 +1111,6 @@ index 8356bfa7e79c4523d98533be51a3cc13fcc50bb6..7eb2e2bfb9e0d29d6c6244f872dc5cd4 + JsonElement ret = getCustom(Constants.CustomModJsonKeys.PROVIDED_JAVADOC); + return ret != null ? ret.getAsString() : null; + } -+ -+ @Override -+ public String getModVersion() { -+ return ModMetadataUtils.readString(jsonObject, "version"); -+ } - public abstract Map getClassTweakers(); + @Override @@ -1124,7 +1131,7 @@ index 8356bfa7e79c4523d98533be51a3cc13fcc50bb6..7eb2e2bfb9e0d29d6c6244f872dc5cd4 } @Override -@@ -78,4 +100,33 @@ public abstract sealed class FabricModJson permits FabricModJsonV0, FabricModJso +@@ -82,4 +100,33 @@ public abstract sealed class FabricModJson permits FabricModJsonV0, FabricModJso throw new AssertionError(); } } @@ -1159,7 +1166,7 @@ index 8356bfa7e79c4523d98533be51a3cc13fcc50bb6..7eb2e2bfb9e0d29d6c6244f872dc5cd4 + } } diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonFactory.java b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonFactory.java -index bbd229164587a7a291b480cd75226e4e23bdda6f..c2d039dbb1312f05f60fd0a9c2f8215d11a8e8a0 100644 +index bbd22916..c2d039db 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonFactory.java +++ b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonFactory.java @@ -24,7 +24,7 @@ @@ -1247,7 +1254,7 @@ index bbd229164587a7a291b480cd75226e4e23bdda6f..c2d039dbb1312f05f60fd0a9c2f8215d - } } diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV0.java b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV0.java -index 935b0cea80d8cd0aa83e1e9cbeba193d268b79c9..dd04356735ed4bdc842821e787dbab12113e1906 100644 +index 935b0cea..dd043567 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV0.java +++ b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV0.java @@ -35,9 +35,13 @@ import com.google.gson.JsonObject; @@ -1292,7 +1299,7 @@ index 935b0cea80d8cd0aa83e1e9cbeba193d268b79c9..dd04356735ed4bdc842821e787dbab12 + } } diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV1.java b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV1.java -index 16239e0bc34a9529bdb10393bbf23697ec504dd7..e4514773f4b1ebe7e28d7261bf59f8b58ea4c9a7 100644 +index 16239e0b..e4514773 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV1.java +++ b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV1.java @@ -24,8 +24,6 @@ @@ -1350,7 +1357,7 @@ index 16239e0bc34a9529bdb10393bbf23697ec504dd7..e4514773f4b1ebe7e28d7261bf59f8b5 } } diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV2.java b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV2.java -index ed52bef4635690bad6aa827c40c44bb3ce426317..0d397423670d447c9232d5fd9266a53aa1e31931 100644 +index ed52bef4..0d397423 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV2.java +++ b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV2.java @@ -36,11 +36,14 @@ import com.google.gson.JsonPrimitive; @@ -1411,7 +1418,7 @@ index ed52bef4635690bad6aa827c40c44bb3ce426317..0d397423670d447c9232d5fd9266a53a } diff --git a/src/main/java/net/fabricmc/loom/util/metadata/ModJsonFactory.java b/src/main/java/net/fabricmc/loom/util/metadata/ModJsonFactory.java new file mode 100644 -index 0000000000000000000000000000000000000000..1af5a154c301b8b18ddef1148b6d05fa1ceddb68 +index 00000000..1af5a154 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/metadata/ModJsonFactory.java @@ -0,0 +1,76 @@ @@ -1495,7 +1502,7 @@ diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonSource.java b similarity index 78% rename from src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonSource.java rename to src/main/java/net/fabricmc/loom/util/metadata/ModJsonSource.java -index 9ff5a7d6a485619b887d5e39079327cc66a4d603..7953be6c2588fbab6169a05bed2cca56cd4a6dac 100644 +index 9ff5a7d6..7953be6c 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonSource.java +++ b/src/main/java/net/fabricmc/loom/util/metadata/ModJsonSource.java @@ -22,7 +22,7 @@ @@ -1554,7 +1561,7 @@ diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonUtils.java b/ similarity index 83% rename from src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonUtils.java rename to src/main/java/net/fabricmc/loom/util/metadata/ModMetadataUtils.java -index 78b94032d504867351f99a4db77c146d4884dcda..0ba04381a8d010cdbdc0dac63b444db5e774444e 100644 +index 78b94032..0ba04381 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonUtils.java +++ b/src/main/java/net/fabricmc/loom/util/metadata/ModMetadataUtils.java @@ -22,7 +22,7 @@ @@ -1608,7 +1615,7 @@ index 78b94032d504867351f99a4db77c146d4884dcda..0ba04381a8d010cdbdc0dac63b444db5 } diff --git a/src/main/java/net/fabricmc/loom/util/qmj/QuiltModJson.java b/src/main/java/net/fabricmc/loom/util/qmj/QuiltModJson.java new file mode 100644 -index 0000000000000000000000000000000000000000..564f038b4b57dae956c70f36f30571c96f608dd8 +index 00000000..564f038b --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/qmj/QuiltModJson.java @@ -0,0 +1,59 @@ @@ -1673,7 +1680,7 @@ index 0000000000000000000000000000000000000000..564f038b4b57dae956c70f36f30571c9 +} diff --git a/src/main/java/net/fabricmc/loom/util/qmj/QuiltModJsonFactory.java b/src/main/java/net/fabricmc/loom/util/qmj/QuiltModJsonFactory.java new file mode 100644 -index 0000000000000000000000000000000000000000..e179a45578d1ef12c15e06e387886ba32cac0f9f +index 00000000..e179a455 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/qmj/QuiltModJsonFactory.java @@ -0,0 +1,118 @@ @@ -1797,7 +1804,7 @@ index 0000000000000000000000000000000000000000..e179a45578d1ef12c15e06e387886ba3 +} diff --git a/src/main/java/net/fabricmc/loom/util/qmj/QuiltModJsonV1.java b/src/main/java/net/fabricmc/loom/util/qmj/QuiltModJsonV1.java new file mode 100644 -index 0000000000000000000000000000000000000000..e80b9576b688f6c4ef9424bb14f0a614841b499d +index 00000000..e80b9576 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/qmj/QuiltModJsonV1.java @@ -0,0 +1,160 @@ @@ -1962,7 +1969,7 @@ index 0000000000000000000000000000000000000000..e80b9576b688f6c4ef9424bb14f0a614 + } +} diff --git a/src/test/groovy/net/fabricmc/loom/test/unit/fmj/FabricModJsonV0Test.groovy b/src/test/groovy/net/fabricmc/loom/test/unit/fmj/FabricModJsonV0Test.groovy -index 3854bb383540450d4f220d1764159d98148365b0..8cbf0995486f700cd8e0da6a15cb216116fb8a64 100644 +index 384c3cf3..0175bfb4 100644 --- a/src/test/groovy/net/fabricmc/loom/test/unit/fmj/FabricModJsonV0Test.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/unit/fmj/FabricModJsonV0Test.groovy @@ -31,7 +31,7 @@ import spock.lang.Specification @@ -1983,7 +1990,7 @@ index 3854bb383540450d4f220d1764159d98148365b0..8cbf0995486f700cd8e0da6a15cb2161 when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: -@@ -66,7 +66,7 @@ class FabricModJsonV0Test extends Specification { +@@ -67,7 +67,7 @@ class FabricModJsonV0Test extends Specification { def "id"() { given: @@ -1992,7 +1999,7 @@ index 3854bb383540450d4f220d1764159d98148365b0..8cbf0995486f700cd8e0da6a15cb2161 when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: -@@ -75,7 +75,7 @@ class FabricModJsonV0Test extends Specification { +@@ -76,7 +76,7 @@ class FabricModJsonV0Test extends Specification { def "mixins"() { given: @@ -2001,7 +2008,7 @@ index 3854bb383540450d4f220d1764159d98148365b0..8cbf0995486f700cd8e0da6a15cb2161 when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: -@@ -88,7 +88,7 @@ class FabricModJsonV0Test extends Specification { +@@ -89,7 +89,7 @@ class FabricModJsonV0Test extends Specification { // Not supported in this version def "injected interfaces"() { given: @@ -2010,7 +2017,7 @@ index 3854bb383540450d4f220d1764159d98148365b0..8cbf0995486f700cd8e0da6a15cb2161 when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) def jsonObject = fmj.getCustom(Constants.CustomModJsonKeys.INJECTED_INTERFACE) -@@ -99,7 +99,7 @@ class FabricModJsonV0Test extends Specification { +@@ -100,7 +100,7 @@ class FabricModJsonV0Test extends Specification { // Not supported in this version def "class tweaker"() { given: @@ -2019,7 +2026,7 @@ index 3854bb383540450d4f220d1764159d98148365b0..8cbf0995486f700cd8e0da6a15cb2161 when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: -@@ -108,7 +108,7 @@ class FabricModJsonV0Test extends Specification { +@@ -109,7 +109,7 @@ class FabricModJsonV0Test extends Specification { def "hash code"() { given: @@ -2029,7 +2036,7 @@ index 3854bb383540450d4f220d1764159d98148365b0..8cbf0995486f700cd8e0da6a15cb2161 def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: diff --git a/src/test/groovy/net/fabricmc/loom/test/unit/fmj/FabricModJsonV1Test.groovy b/src/test/groovy/net/fabricmc/loom/test/unit/fmj/FabricModJsonV1Test.groovy -index 3a79e965feb458ab8bc3a33f8555705ba6e4f219..7050c44f067b06a4354faecbf20e8fba7efc72b5 100644 +index 9053d14f..04dffd76 100644 --- a/src/test/groovy/net/fabricmc/loom/test/unit/fmj/FabricModJsonV1Test.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/unit/fmj/FabricModJsonV1Test.groovy @@ -29,10 +29,10 @@ import com.google.gson.JsonObject @@ -2054,7 +2061,7 @@ index 3a79e965feb458ab8bc3a33f8555705ba6e4f219..7050c44f067b06a4354faecbf20e8fba when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: -@@ -73,7 +73,7 @@ class FabricModJsonV1Test extends Specification { +@@ -74,7 +74,7 @@ class FabricModJsonV1Test extends Specification { def "id"() { given: @@ -2063,7 +2070,7 @@ index 3a79e965feb458ab8bc3a33f8555705ba6e4f219..7050c44f067b06a4354faecbf20e8fba when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: -@@ -82,7 +82,7 @@ class FabricModJsonV1Test extends Specification { +@@ -83,7 +83,7 @@ class FabricModJsonV1Test extends Specification { def "mixins"() { given: @@ -2072,7 +2079,7 @@ index 3a79e965feb458ab8bc3a33f8555705ba6e4f219..7050c44f067b06a4354faecbf20e8fba when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: -@@ -94,7 +94,7 @@ class FabricModJsonV1Test extends Specification { +@@ -95,7 +95,7 @@ class FabricModJsonV1Test extends Specification { def "injected interfaces"() { given: @@ -2081,7 +2088,7 @@ index 3a79e965feb458ab8bc3a33f8555705ba6e4f219..7050c44f067b06a4354faecbf20e8fba when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) def jsonObject = fmj.getCustom(Constants.CustomModJsonKeys.INJECTED_INTERFACE) -@@ -105,7 +105,7 @@ class FabricModJsonV1Test extends Specification { +@@ -106,7 +106,7 @@ class FabricModJsonV1Test extends Specification { def "access widener"() { given: @@ -2090,7 +2097,7 @@ index 3a79e965feb458ab8bc3a33f8555705ba6e4f219..7050c44f067b06a4354faecbf20e8fba when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: -@@ -114,7 +114,7 @@ class FabricModJsonV1Test extends Specification { +@@ -115,7 +115,7 @@ class FabricModJsonV1Test extends Specification { def "hash code"() { given: @@ -2100,7 +2107,7 @@ index 3a79e965feb458ab8bc3a33f8555705ba6e4f219..7050c44f067b06a4354faecbf20e8fba def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: diff --git a/src/test/groovy/net/fabricmc/loom/test/unit/fmj/FabricModJsonV2Test.groovy b/src/test/groovy/net/fabricmc/loom/test/unit/fmj/FabricModJsonV2Test.groovy -index 1cea56c90689de25586f1a0dbbfeb4ad246ad8d4..1cf7e794abcb35bc303a505b02713a6430af8d29 100644 +index 212de2ac..e94b8751 100644 --- a/src/test/groovy/net/fabricmc/loom/test/unit/fmj/FabricModJsonV2Test.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/unit/fmj/FabricModJsonV2Test.groovy @@ -29,10 +29,10 @@ import com.google.gson.JsonObject @@ -2125,7 +2132,7 @@ index 1cea56c90689de25586f1a0dbbfeb4ad246ad8d4..1cf7e794abcb35bc303a505b02713a64 when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: -@@ -87,7 +87,7 @@ class FabricModJsonV2Test extends Specification { +@@ -88,7 +88,7 @@ class FabricModJsonV2Test extends Specification { def "id"() { given: @@ -2134,7 +2141,7 @@ index 1cea56c90689de25586f1a0dbbfeb4ad246ad8d4..1cf7e794abcb35bc303a505b02713a64 when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: -@@ -96,7 +96,7 @@ class FabricModJsonV2Test extends Specification { +@@ -97,7 +97,7 @@ class FabricModJsonV2Test extends Specification { def "mixins"() { given: @@ -2143,7 +2150,7 @@ index 1cea56c90689de25586f1a0dbbfeb4ad246ad8d4..1cf7e794abcb35bc303a505b02713a64 when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: -@@ -109,7 +109,7 @@ class FabricModJsonV2Test extends Specification { +@@ -110,7 +110,7 @@ class FabricModJsonV2Test extends Specification { def "injected interfaces"() { given: @@ -2152,7 +2159,7 @@ index 1cea56c90689de25586f1a0dbbfeb4ad246ad8d4..1cf7e794abcb35bc303a505b02713a64 when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) def jsonObject = fmj.getCustom(Constants.CustomModJsonKeys.INJECTED_INTERFACE) -@@ -120,7 +120,7 @@ class FabricModJsonV2Test extends Specification { +@@ -121,7 +121,7 @@ class FabricModJsonV2Test extends Specification { def "class tweakers"() { given: @@ -2161,7 +2168,7 @@ index 1cea56c90689de25586f1a0dbbfeb4ad246ad8d4..1cf7e794abcb35bc303a505b02713a64 when: def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: -@@ -133,7 +133,7 @@ class FabricModJsonV2Test extends Specification { +@@ -134,7 +134,7 @@ class FabricModJsonV2Test extends Specification { def "hash code"() { given: @@ -2171,7 +2178,7 @@ index 1cea56c90689de25586f1a0dbbfeb4ad246ad8d4..1cf7e794abcb35bc303a505b02713a64 def fmj = FabricModJsonFactory.create(JSON_OBJECT, mockSource) then: diff --git a/src/test/groovy/net/fabricmc/loom/test/unit/processor/AccessWidenerJarProcessorTest.groovy b/src/test/groovy/net/fabricmc/loom/test/unit/processor/AccessWidenerJarProcessorTest.groovy -index 19a55536ed767787d0c7ecf218fc8469aa7412b0..4d12ba111d91c301f0da84cc07213be372db05a2 100644 +index 19a55536..4d12ba11 100644 --- a/src/test/groovy/net/fabricmc/loom/test/unit/processor/AccessWidenerJarProcessorTest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/unit/processor/AccessWidenerJarProcessorTest.groovy @@ -28,9 +28,9 @@ import spock.lang.Specification @@ -2186,7 +2193,7 @@ index 19a55536ed767787d0c7ecf218fc8469aa7412b0..4d12ba111d91c301f0da84cc07213be3 class AccessWidenerJarProcessorTest extends Specification { def "Local AW"() { diff --git a/src/test/groovy/net/fabricmc/loom/test/unit/processor/ModAccessWidenerEntryTest.groovy b/src/test/groovy/net/fabricmc/loom/test/unit/processor/ModAccessWidenerEntryTest.groovy -index 5b23d99780c9be5300cf6c6c2ccb32a0724a0ce9..da27fecae2d10027501a467c82cc3bb70133ecc4 100644 +index 5b23d997..da27feca 100644 --- a/src/test/groovy/net/fabricmc/loom/test/unit/processor/ModAccessWidenerEntryTest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/unit/processor/ModAccessWidenerEntryTest.groovy @@ -27,8 +27,8 @@ package net.fabricmc.loom.test.unit.processor diff --git a/patches/0004-Support-QMJ5-too-experimental.patch b/patches/0004-Support-QMJ5-too-experimental.patch index db997aa..cd11f89 100644 --- a/patches/0004-Support-QMJ5-too-experimental.patch +++ b/patches/0004-Support-QMJ5-too-experimental.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Support QMJ5 too (experimental!) If implemented into Loader, this will be squashed into the previous commit. diff --git a/build.gradle b/build.gradle -index 6df36c1184b3ee5581c68bb46d3004adc308b1ef..66d98ff968b3552d1756140f1badef0438a43b0b 100644 +index 32442f2a..e15e9d26 100644 --- a/build.gradle +++ b/build.gradle @@ -70,6 +70,11 @@ repositories { @@ -21,7 +21,7 @@ index 6df36c1184b3ee5581c68bb46d3004adc308b1ef..66d98ff968b3552d1756140f1badef04 mavenCentral() } -@@ -167,6 +172,10 @@ dependencies { +@@ -166,6 +171,10 @@ dependencies { // Kapt integration compileOnly libs.kotlin.gradle.plugin @@ -33,7 +33,7 @@ index 6df36c1184b3ee5581c68bb46d3004adc308b1ef..66d98ff968b3552d1756140f1badef04 testImplementation(gradleTestKit()) testImplementation(testLibs.spock) { diff --git a/src/main/java/net/fabricmc/loom/configuration/metadata/ModMetadataHelper.java b/src/main/java/net/fabricmc/loom/configuration/metadata/ModMetadataHelper.java -index 490240ac688d7fddba464b70005d7c236265c9b2..449a396362c36fa0ed33a0236ab03e80cd1fd8a1 100644 +index 490240ac..449a3963 100644 --- a/src/main/java/net/fabricmc/loom/configuration/metadata/ModMetadataHelper.java +++ b/src/main/java/net/fabricmc/loom/configuration/metadata/ModMetadataHelper.java @@ -46,6 +46,7 @@ import net.fabricmc.loom.util.metadata.ModJsonFactory; @@ -82,26 +82,8 @@ index 490240ac688d7fddba464b70005d7c236265c9b2..449a396362c36fa0ed33a0236ab03e80 + return FABRIC_MOD_JSON; } } -diff --git a/src/main/java/net/fabricmc/loom/extension/ModVersionParser.java b/src/main/java/net/fabricmc/loom/extension/ModVersionParser.java -index 6b2099e99f220c336a7c6fa0f229b8ecd474b1fb..b8aacec03c84745d285dda182b2978d1f1ef10dd 100644 ---- a/src/main/java/net/fabricmc/loom/extension/ModVersionParser.java -+++ b/src/main/java/net/fabricmc/loom/extension/ModVersionParser.java -@@ -68,9 +68,12 @@ public class ModVersionParser { - - private File locateModJsonFile() { - var resources = project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets().getByName("main").getResources(); -+ var qmj5 = resources.matching(patternFilterable -> patternFilterable.include("quilt.mod.json5")); - var qmj = resources.matching(patternFilterable -> patternFilterable.include("quilt.mod.json")); - -- if (!qmj.isEmpty()) { -+ if (!qmj5.isEmpty()) { -+ return qmj5.getSingleFile(); -+ } else if (!qmj.isEmpty()) { - return qmj.getSingleFile(); - } else { - return resources.matching(patternFilterable -> patternFilterable.include("fabric.mod.json")).getSingleFile(); diff --git a/src/main/java/net/fabricmc/loom/task/AbstractRemapJarTask.java b/src/main/java/net/fabricmc/loom/task/AbstractRemapJarTask.java -index 7da1ea1e580ddcd83153750031aed0f2a510b4f6..1126c8cb52e930426252d296b42c3a699b70eeb5 100644 +index e0f2abf1..e0ba5d74 100644 --- a/src/main/java/net/fabricmc/loom/task/AbstractRemapJarTask.java +++ b/src/main/java/net/fabricmc/loom/task/AbstractRemapJarTask.java @@ -28,6 +28,7 @@ import java.io.ByteArrayInputStream; @@ -112,7 +94,7 @@ index 7da1ea1e580ddcd83153750031aed0f2a510b4f6..1126c8cb52e930426252d296b42c3a69 import java.nio.file.Path; import java.util.ArrayList; import java.util.Collections; -@@ -41,6 +42,7 @@ import java.util.jar.Manifest; +@@ -40,6 +41,7 @@ import java.util.jar.Manifest; import javax.inject.Inject; import com.google.common.base.Preconditions; @@ -120,7 +102,7 @@ index 7da1ea1e580ddcd83153750031aed0f2a510b4f6..1126c8cb52e930426252d296b42c3a69 import org.gradle.api.Action; import org.gradle.api.file.ConfigurableFileCollection; import org.gradle.api.file.RegularFileProperty; -@@ -62,8 +64,11 @@ import org.gradle.workers.WorkParameters; +@@ -61,8 +63,11 @@ import org.gradle.workers.WorkParameters; import org.gradle.workers.WorkQueue; import org.gradle.workers.WorkerExecutor; import org.jetbrains.annotations.ApiStatus; @@ -131,17 +113,18 @@ index 7da1ea1e580ddcd83153750031aed0f2a510b4f6..1126c8cb52e930426252d296b42c3a69 +import net.fabricmc.loom.LoomGradlePlugin; import net.fabricmc.loom.api.mappings.layered.MappingsNamespace; import net.fabricmc.loom.task.service.JarManifestService; - import net.fabricmc.loom.util.ZipReprocessorUtil; -@@ -78,6 +83,8 @@ public abstract class AbstractRemapJarTask extends Jar { - public static final String MANIFEST_JAR_TYPE_KEY = "Fabric-Jar-Type"; - public static final Attributes.Name MANIFEST_SPLIT_ENV_NAME = new Attributes.Name(MANIFEST_SPLIT_ENV_KEY); - public static final Attributes.Name MANIFEST_CLIENT_ENTRIES_NAME = new Attributes.Name(MANIFEST_CLIENT_ENTRIES_KEY); + import net.fabricmc.loom.util.Constants; +@@ -71,6 +76,9 @@ import net.fabricmc.loom.util.ZipUtils; + import net.fabricmc.loom.util.gradle.SourceSetHelper; + + public abstract class AbstractRemapJarTask extends Jar { + public static final String QUILT_MOD_JSON5_PATH = "quilt.mod.json5"; + public static final String QUILT_MOD_JSON_PATH = "quilt.mod.json"; - ++ @InputFile public abstract RegularFileProperty getInputFile(); -@@ -200,6 +207,18 @@ public abstract class AbstractRemapJarTask extends Jar { + +@@ -204,6 +212,18 @@ public abstract class AbstractRemapJarTask extends Jar { outputFile = getParameters().getOutputFile().getAsFile().get().toPath(); } @@ -158,13 +141,13 @@ index 7da1ea1e580ddcd83153750031aed0f2a510b4f6..1126c8cb52e930426252d296b42c3a69 + } + protected void modifyJarManifest() throws IOException { - int count = ZipUtils.transform(outputFile, Map.of(MANIFEST_PATH, bytes -> { + int count = ZipUtils.transform(outputFile, Map.of(Constants.Manifest.PATH, bytes -> { var manifest = new Manifest(new ByteArrayInputStream(bytes)); diff --git a/src/main/java/net/fabricmc/loom/task/RemapJarTask.java b/src/main/java/net/fabricmc/loom/task/RemapJarTask.java -index 71ccb96214c455694fe9e824991b7cca0075cc1d..c6da0fd215b4d15ea506d30dcaee4c6ce3b59e9c 100644 +index 2c2a35c4..8173c8a7 100644 --- a/src/main/java/net/fabricmc/loom/task/RemapJarTask.java +++ b/src/main/java/net/fabricmc/loom/task/RemapJarTask.java -@@ -221,6 +221,7 @@ public abstract class RemapJarTask extends AbstractRemapJarTask { +@@ -238,6 +238,7 @@ public abstract class RemapJarTask extends AbstractRemapJarTask { markClientOnlyClasses(); } @@ -173,19 +156,19 @@ index 71ccb96214c455694fe9e824991b7cca0075cc1d..c6da0fd215b4d15ea506d30dcaee4c6c addRefmaps(); addNestedJars(); diff --git a/src/main/java/net/fabricmc/loom/task/RemapSourcesJarTask.java b/src/main/java/net/fabricmc/loom/task/RemapSourcesJarTask.java -index 2a9424acc87f88c62cb2e9595dea0c80300de0ba..1f46e09dada6bf1b3de84283f24421939b698a5c 100644 +index f0aa6d89..3b6141db 100644 --- a/src/main/java/net/fabricmc/loom/task/RemapSourcesJarTask.java +++ b/src/main/java/net/fabricmc/loom/task/RemapSourcesJarTask.java -@@ -88,6 +88,7 @@ public abstract class RemapSourcesJarTask extends AbstractRemapJarTask { - try { - sourceRemapperService.remapSourcesJar(inputFile, outputFile); +@@ -98,6 +98,7 @@ public abstract class RemapSourcesJarTask extends AbstractRemapJarTask { + Files.copy(inputFile, outputFile, StandardCopyOption.REPLACE_EXISTING); + } + convertQmj5ToQmj(); modifyJarManifest(); rewriteJar(); } catch (Exception e) { diff --git a/src/main/java/net/fabricmc/loom/task/launch/GenerateDLIConfigTask.java b/src/main/java/net/fabricmc/loom/task/launch/GenerateDLIConfigTask.java -index 53a0976dfbb51cdcbd444380904145b87eecc110..b206c7077f47fd31cd50bd289e5b6513db645a79 100644 +index 53a0976d..b206c707 100644 --- a/src/main/java/net/fabricmc/loom/task/launch/GenerateDLIConfigTask.java +++ b/src/main/java/net/fabricmc/loom/task/launch/GenerateDLIConfigTask.java @@ -57,6 +57,7 @@ public abstract class GenerateDLIConfigTask extends AbstractLoomTask { @@ -197,7 +180,7 @@ index 53a0976dfbb51cdcbd444380904145b87eecc110..b206c7077f47fd31cd50bd289e5b6513 .property("log4j2.formatMsgNoLookups", "true") diff --git a/src/main/java/net/fabricmc/loom/util/ZipUtils.java b/src/main/java/net/fabricmc/loom/util/ZipUtils.java -index f6214aed8a99b99af52dcca76d78a36c2cf29213..c7fded73c2da28df3f02dfe54ce2c561b1da22bf 100644 +index 9b387ad9..3159594d 100644 --- a/src/main/java/net/fabricmc/loom/util/ZipUtils.java +++ b/src/main/java/net/fabricmc/loom/util/ZipUtils.java @@ -47,6 +47,8 @@ import org.jetbrains.annotations.Nullable; @@ -237,7 +220,7 @@ index f6214aed8a99b99af52dcca76d78a36c2cf29213..c7fded73c2da28df3f02dfe54ce2c561 + public static T unpackJackson(Path zip, String path, Class clazz) throws IOException { final byte[] bytes = unpack(zip, path); - return LoomGradlePlugin.OBJECT_MAPPER.readValue(new String(bytes, StandardCharsets.UTF_8), clazz); + return LoomGradlePlugin.GSON.fromJson(new String(bytes, StandardCharsets.UTF_8), clazz); @@ -184,6 +201,20 @@ public class ZipUtils { } } @@ -260,7 +243,7 @@ index f6214aed8a99b99af52dcca76d78a36c2cf29213..c7fded73c2da28df3f02dfe54ce2c561 return transformString(zip, transforms.stream()); } diff --git a/src/main/java/net/fabricmc/loom/util/metadata/ModJsonFactory.java b/src/main/java/net/fabricmc/loom/util/metadata/ModJsonFactory.java -index 1af5a154c301b8b18ddef1148b6d05fa1ceddb68..4b26643a6fc9d22071b4c7b34a23c2e034b7e107 100644 +index 1af5a154..4b26643a 100644 --- a/src/main/java/net/fabricmc/loom/util/metadata/ModJsonFactory.java +++ b/src/main/java/net/fabricmc/loom/util/metadata/ModJsonFactory.java @@ -39,25 +39,34 @@ import net.fabricmc.loom.util.gradle.SourceSetHelper; @@ -324,7 +307,7 @@ index 1af5a154c301b8b18ddef1148b6d05fa1ceddb68..4b26643a6fc9d22071b4c7b34a23c2e0 return FabricModJsonFactory.createFromSourceSetsNullable(sourceSets); } diff --git a/src/main/java/net/fabricmc/loom/util/qmj/QuiltModJsonFactory.java b/src/main/java/net/fabricmc/loom/util/qmj/QuiltModJsonFactory.java -index e179a45578d1ef12c15e06e387886ba32cac0f9f..b9ed2d676977e679b31bef14fadde370685d0312 100644 +index e179a455..b9ed2d67 100644 --- a/src/main/java/net/fabricmc/loom/util/qmj/QuiltModJsonFactory.java +++ b/src/main/java/net/fabricmc/loom/util/qmj/QuiltModJsonFactory.java @@ -39,6 +39,8 @@ import com.google.gson.JsonObject; diff --git a/patches/0005-Fix-mappingsConstants-dependency-being-added-even-if.patch b/patches/0005-Fix-mappingsConstants-dependency-being-added-even-if.patch index 1a2ea3e..c11b6b8 100644 --- a/patches/0005-Fix-mappingsConstants-dependency-being-added-even-if.patch +++ b/patches/0005-Fix-mappingsConstants-dependency-being-added-even-if.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Fix mappingsConstants dependency being added even if already Implements https://github.com/FabricMC/fabric-loom/pull/605 diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/MappingConfiguration.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/MappingConfiguration.java -index 8321d3dec5880e13a3684939af689c55ee4220b0..a568376ef7de2356ec8bf5535e3e29f2f71b73d6 100644 +index bce9d5d0..faa3f6ce 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/MappingConfiguration.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/MappingConfiguration.java @@ -141,13 +141,19 @@ public class MappingConfiguration {