mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 13:37:45 -05:00
@@ -82,7 +82,7 @@ public class ModCompileRemapper {
|
||||
String name = artifact.getModuleVersion().getId().getName();
|
||||
String version = artifact.getModuleVersion().getId().getVersion();
|
||||
|
||||
if (!shouldRemapMod(logger, artifact, extension.isForge(), sourceConfig.getName())) {
|
||||
if (!shouldRemapMod(logger, artifact, extension.isForge(), sourceConfig.getName())) {
|
||||
addToRegularCompile(project, regularConfig, artifact);
|
||||
continue;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class ModCompileRemapper {
|
||||
|
||||
modDependencies.add(info);
|
||||
|
||||
String remappedLog = group + ":" + name + ":" + version + (artifact.getClassifier() == null ? "" : ":" + artifact.getClassifier()) + " (" + mappingsSuffix + ")" + (info.requiresRemapping() ? " requires remapping" : " already remapped in " + info.getRemappedOutput().getAbsolutePath());
|
||||
String remappedLog = group + ":" + name + ":" + version + (artifact.getClassifier() == null ? "" : ":" + artifact.getClassifier()) + " (" + mappingsSuffix + ")" + (info.requiresRemapping() ? " requires remapping" : " already remapped in " + info.getRemappedOutput().getAbsolutePath());
|
||||
project.getLogger().info(":providing " + remappedLog);
|
||||
|
||||
File remappedSources = info.getRemappedOutput("sources");
|
||||
@@ -119,7 +119,7 @@ public class ModCompileRemapper {
|
||||
|
||||
// Add all of the remapped mods onto the config
|
||||
for (ModDependencyInfo info : modDependencies) {
|
||||
project.getLogger().info(":adding " + info.toString() + " into " + info.targetConfig.getName());
|
||||
project.getLogger().info(":adding " + info.toString() + " into " + info.targetConfig.getName());
|
||||
project.getDependencies().add(info.targetConfig.getName(), info.getRemappedNotation());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -62,7 +62,7 @@ public final class MavenPublication {
|
||||
|
||||
Configuration compileModsConfig = p.getConfigurations().getByName(entry.sourceConfiguration());
|
||||
|
||||
p.getLogger().info("Processing maven publication for project [" + p.getName() + "] of " + entry.getSourceConfiguration());
|
||||
p.getLogger().info("Processing maven publication for project [" + p.getName() + "] of " + entry.sourceConfiguration());
|
||||
processEntry(p.getLogger(), entry, compileModsConfig, mavenPublish);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -50,7 +50,6 @@ import com.google.gson.JsonObject;
|
||||
import dev.architectury.tinyremapper.InputTag;
|
||||
import dev.architectury.tinyremapper.OutputConsumerPath;
|
||||
import dev.architectury.tinyremapper.TinyRemapper;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.gradle.api.Project;
|
||||
import org.objectweb.asm.commons.Remapper;
|
||||
import org.zeroturnaround.zip.ZipUtil;
|
||||
|
||||
@@ -61,8 +61,6 @@ public class MinecraftProvider extends DependencyProvider {
|
||||
private File versionManifestJson;
|
||||
private String jarSuffix = "";
|
||||
|
||||
Gson gson = new Gson();
|
||||
|
||||
public MinecraftProvider(Project project) {
|
||||
super(project);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,6 @@ import net.fabricmc.mapping.tree.TinyTree;
|
||||
import net.fabricmc.stitch.Command;
|
||||
import net.fabricmc.stitch.commands.CommandProposeFieldNames;
|
||||
import net.fabricmc.stitch.commands.tinyv2.CommandMergeTinyV2;
|
||||
import net.fabricmc.stitch.commands.tinyv2.CommandReorderTinyV2;
|
||||
import net.fabricmc.stitch.commands.tinyv2.TinyFile;
|
||||
import net.fabricmc.stitch.commands.tinyv2.TinyV2Writer;
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ public class MinecraftAssetsProvider {
|
||||
try {
|
||||
for (Map.Entry<String, AssetObject> entry : parent.entrySet()) {
|
||||
AssetObject object = entry.getValue();
|
||||
String sha1 = object.hash();
|
||||
String sha1 = object.hash();
|
||||
String filename = "objects" + File.separator + sha1.substring(0, 2) + File.separator + sha1;
|
||||
File file = new File(assets, filename);
|
||||
|
||||
|
||||
@@ -34,11 +34,14 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.tools.ant.taskdefs.condition.Os;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.tasks.TaskAction;
|
||||
|
||||
import net.fabricmc.loom.LoomGradleExtension;
|
||||
import net.fabricmc.loom.LoomGradlePlugin;
|
||||
import net.fabricmc.loom.configuration.ide.RunConfig;
|
||||
import net.fabricmc.loom.configuration.ide.RunConfigSettings;
|
||||
|
||||
@@ -86,7 +86,6 @@ import net.fabricmc.loom.util.Constants;
|
||||
import net.fabricmc.loom.util.SourceRemapper;
|
||||
import net.fabricmc.loom.util.TinyRemapperMappingsHelper;
|
||||
import net.fabricmc.loom.util.ZipReprocessorUtil;
|
||||
import net.fabricmc.loom.util.gradle.GradleSupport;
|
||||
import net.fabricmc.mapping.tree.ClassDef;
|
||||
import net.fabricmc.mapping.tree.FieldDef;
|
||||
import net.fabricmc.mapping.tree.MethodDef;
|
||||
|
||||
@@ -38,7 +38,6 @@ import java.util.List;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.gradle.api.logging.Logger;
|
||||
|
||||
import net.fabricmc.loom.util.function.CollectionUtil;
|
||||
@@ -55,7 +54,7 @@ public final class AtRemapper {
|
||||
Path atPath = fs.getPath("META-INF/accesstransformer.cfg");
|
||||
|
||||
if (Files.exists(atPath)) {
|
||||
String atContent = new String(Files.readAllBytes(atPath), StandardCharsets.UTF_8);
|
||||
String atContent = Files.readString(atPath);
|
||||
|
||||
String[] lines = atContent.split("\n");
|
||||
List<String> output = new ArrayList<>(lines.length);
|
||||
@@ -63,7 +62,7 @@ public final class AtRemapper {
|
||||
for (int i = 0; i < lines.length; i++) {
|
||||
String line = lines[i].trim();
|
||||
|
||||
if (line.startsWith("#") || Strings.isBlank(line)) {
|
||||
if (line.startsWith("#") || line.isBlank()) {
|
||||
output.add(i, line);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.gradle.api.logging.Logger;
|
||||
|
||||
import net.fabricmc.loom.util.function.CollectionUtil;
|
||||
@@ -109,7 +108,7 @@ public final class CoreModClassRemapper {
|
||||
|
||||
if (!lines.equals(output)) {
|
||||
try (Writer writer = Files.newBufferedWriter(js, StandardCharsets.UTF_8, StandardOpenOption.WRITE)) {
|
||||
writer.write(String.join(Strings.LINE_SEPARATOR, output));
|
||||
writer.write(String.join("\n", output));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ public class MCPReader {
|
||||
}
|
||||
}
|
||||
|
||||
try (FileSystem fs = FileSystems.newFileSystem(mcpJar, null)) {
|
||||
try (FileSystem fs = FileSystems.newFileSystem(mcpJar, (ClassLoader) null)) {
|
||||
Path fields = fs.getPath("fields.csv");
|
||||
Path methods = fs.getPath("methods.csv");
|
||||
Path params = fs.getPath("params.csv");
|
||||
|
||||
Reference in New Issue
Block a user