Skip to content

Commit

Permalink
1.5 attempt #2
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGlitch76 committed Mar 12, 2024
1 parent bf0261e commit 7719b45
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 582 deletions.
2 changes: 1 addition & 1 deletion fabric-loom
Submodule fabric-loom updated 120 files
40 changes: 20 additions & 20 deletions patches/0001-Initial-Quiltification.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 de84c29fa40819a31c2e55389d201f86456eda67..eaabc2b3ce2ef925e7deb635dc18894b73dbcc4d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -49,7 +49,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
Expand 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 {
Expand All @@ -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 ->
Expand All @@ -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'))
Expand All @@ -67,15 +67,15 @@ 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 {
+ name = 'release'
if (ENV.MAVEN_URL) {
url ENV.MAVEN_URL
credentials {
@@ -340,6 +347,26 @@ publishing {
@@ -341,6 +348,26 @@ publishing {
}
}
}
Expand Down Expand Up @@ -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 71248d2d72437815aecbee42d01ee4ec62589a65..76a88fc552f9324bb9d56c57a68fd50494bb4ee0 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) {
Expand Down Expand Up @@ -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 6965a0bf521d30bf581819f5ceb07a025238abe1..8d2f1807003ada50dce5cbca57005e14bbb343fe 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<Mapp
@@ -75,7 +75,7 @@ public class SingleJarDecompileConfiguration extends DecompileConfiguration<Mapp
task.setDescription("Decompile minecraft using the default decompiler.");
task.setGroup(Constants.TaskGroup.FABRIC);

Expand All @@ -172,10 +172,10 @@ index 538c3018b085067e3d0e99d6fc8a0530b07cf6e9..9e4b9dbb1d8d837653fe4d1acebebfc2
}
}
diff --git a/src/main/java/net/fabricmc/loom/configuration/decompile/SplitDecompileConfiguration.java b/src/main/java/net/fabricmc/loom/configuration/decompile/SplitDecompileConfiguration.java
index 0cf8fbe389b957ca3d2024afd98b5a52e6a537b0..3d1a030cf2fbe7fbf57f834f362cb8aa93e22b12 100644
index 0c8df985145397f23148c9bcf9e3db394a4b278c..8e6e56fe01d235bbb42e017523202234ff99251a 100644
--- a/src/main/java/net/fabricmc/loom/configuration/decompile/SplitDecompileConfiguration.java
+++ b/src/main/java/net/fabricmc/loom/configuration/decompile/SplitDecompileConfiguration.java
@@ -108,7 +108,7 @@ public final class SplitDecompileConfiguration extends DecompileConfiguration<Ma
@@ -114,7 +114,7 @@ public final class SplitDecompileConfiguration extends DecompileConfiguration<Ma
task.setDescription("Decompile minecraft (%s) using the default decompiler.".formatted(name));
task.setGroup(Constants.TaskGroup.FABRIC);

Expand All @@ -185,18 +185,18 @@ index 0cf8fbe389b957ca3d2024afd98b5a52e6a537b0..3d1a030cf2fbe7fbf57f834f362cb8aa
}
}
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 024a35c8843e8f866f3885a1414124854bfe97ef..7274912e12820e697991389626d5bda87ddd1162 100644
index 057cde42e019d890d7a9289bde235ff0efc35a7b..c7e91aca57ae87cdff349bde65db713778ae780d 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,7 @@ import net.fabricmc.loom.util.FileSystemUtil;
@@ -44,7 +44,7 @@ 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 = "fabric-installer.json";
+ private static final String INSTALLER_PATH = "quilt_installer.json";
private static final String MANIFEST_PATH = "META-INF/MANIFEST.MF";
private static final String MANIFEST_REMAP_KEY = "Fabric-Loom-Remap";

public static ArtifactMetadata create(ArtifactRef artifact, String currentLoomVersion) throws IOException {
boolean isFabricMod;
diff --git a/src/main/java/net/fabricmc/loom/extension/LoomFilesBaseImpl.java b/src/main/java/net/fabricmc/loom/extension/LoomFilesBaseImpl.java
index d7f0c469b92b3acfb24a623306f8d63bf44eafbe..12f19648c39d6eec91d8bd09cdd3400aadac3ca3 100644
--- a/src/main/java/net/fabricmc/loom/extension/LoomFilesBaseImpl.java
Expand Down Expand Up @@ -294,7 +294,7 @@ index b3f5456c1317acc23b903df9451b59683d677dcf..18341c50640d4e42f2391ae46c3d2be7
}

diff --git a/src/main/java/net/fabricmc/loom/util/Constants.java b/src/main/java/net/fabricmc/loom/util/Constants.java
index 42692aabc0c49424b9fab10ae84b627ce6f5a9d5..4ad7a56e0eb19032b16b570208021dac077a03cf 100644
index 100835711ceb553290db67f79dc503849aeb529d..e4de3dd627a8dd0597dedfb176e8e3ffff5aa2e4 100644
--- a/src/main/java/net/fabricmc/loom/util/Constants.java
+++ b/src/main/java/net/fabricmc/loom/util/Constants.java
@@ -32,6 +32,7 @@ public class Constants {
Expand Down Expand Up @@ -323,7 +323,7 @@ index 3350a985f73e403f086a2a988283cbe4644d0cc2..eef1cd42b1e53497012165e1580c6199
+ }
}
diff --git a/src/main/java/net/fabricmc/loom/util/SourceRemapper.java b/src/main/java/net/fabricmc/loom/util/SourceRemapper.java
index 1f4fca35e5773219317492661abadbc3161ecba1..c70e73680419435ee83960c21518ce6734fac9ab 100644
index f008293d79e9551b11cd5cf27cc77c628af5c8af..7d4b0ab9a6cfeaec34ed485150a43b6bc49f6c93 100644
--- a/src/main/java/net/fabricmc/loom/util/SourceRemapper.java
+++ b/src/main/java/net/fabricmc/loom/util/SourceRemapper.java
@@ -128,7 +128,7 @@ public class SourceRemapper {
Expand Down
36 changes: 20 additions & 16 deletions patches/0002-Exclude-Fabric-dependencies-replaced-by-Quilt.patch
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@ 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 c7e91aca57ae87cdff349bde65db713778ae780d..1375a06a482ee210cd7cf35f15e3923043de79f9 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,9 @@ 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 +83,17 @@ public record ArtifactMetadata(boolean isFabricMod, RemapRequirements remapRequi
}
}

Expand All @@ -54,12 +55,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 61a4d8443dd63ede7a8be66f9633f17459e5ae76..4fca0b0d5149eec1468e6ca8072951c23e466321 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;
Expand All @@ -78,15 +79,15 @@ 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;
-import net.fabricmc.loom.configuration.mods.dependency.ModDependencyFactory;
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,23 @@ public class ModConfigurationRemapper {
}

// Round 1: Discovery
Expand All @@ -98,6 +99,7 @@ index 7ff0fbc78dc242a82a925ca72dd85168116aa115..86316049c4c17f9362ab3a10cb25489d
+ // The presence of Quilt Loader/QSL will be used to exclude the Fabric equivalents if needed.
+
final Map<Configuration, List<ModDependency>> dependenciesBySourceConfig = new HashMap<>();
final Map<ArtifactRef, ArtifactMetadata> metaCache = new HashMap<>();
+ final Map<Configuration, List<ArtifactRef>> artifactsBySourceConfig = new HashMap<>();
+ final Set<Configuration> sourceConfigsWithQsl = new HashSet<>();
+ // todo clean this up
Expand All @@ -117,9 +119,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,22 +168,76 @@ public class ModConfigurationRemapper {
});

if (artifactMetadata.installerData() != null) {
- if (extension.getInstallerData() != null) {
Expand Down Expand Up @@ -148,6 +150,7 @@ index 7ff0fbc78dc242a82a925ca72dd85168116aa115..86316049c4c17f9362ab3a10cb25489d
continue;
}

- final ModDependency modDependency = ModDependencyFactory.create(artifact, artifactMetadata, remappedConfig, clientRemappedConfig, mappingsSuffix, project);
+ if (artifact.group().startsWith("org.quiltmc.qsl")) {
+ sourceConfigsWithQsl.add(sourceConfig);
+ }
Expand Down Expand Up @@ -195,9 +198,10 @@ 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 ModDependency modDependency = ModDependencyFactory.create(artifact, metaCache.get(artifact), 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
--- a/src/test/groovy/net/fabricmc/loom/test/integration/MavenProjectTest.groovy
Expand All @@ -219,7 +223,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 c5669df049673b8800bf9d1cd2b3e9638c20a47d..18e060e5b279b0b2c57d325fc7cb8fcb936a6ac7 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
Expand Down
Loading

0 comments on commit 7719b45

Please sign in to comment.