Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ jobs:
strategy:
matrix:
command: [
"--forge --version 1.21.11-61.1.0",
"--forge --version 1.20.1-47.4.0",
"--forge --version 1.12.2-14.23.5.2859 --mappings snapshot:20171003-1.12",
"--forge --version 26.1-62.0.0",
"--client --version 1.20.1",
"--forge --version 1.6.4-9.11.1.964", # FG 1.0
"--forge --version 1.7.10-10.13.4.1614-1.7.10", # FG 1.1
"--forge --version 1.8.9-11.15.1.2318-1.8.9", # FG 2.1
"--forge --version 1.12.2-14.23.5.2864", # FG
"--forge --version 1.20.1-47.4.0", # FG 3
"--forge --version 1.21.11-61.1.0", # FG 6 Official names
"--forge --version 26.1-62.0.0", # FG 6 No obfusation
"--client --version 1.20.1", # MCPConfig, full decompile/recompile poissible
"--server --version 1.20.1",
"--mc --version 1.20.1",
"--client --version 26.1-snapshot-1",
"--client --version 26.1-snapshot-1", # No MCPConfig, unobfuscated, No Recompile possible
"--server --version 26.1-snapshot-1"
]

Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ license {
header = rootProject.file('LICENSE-header.txt')
newLine false
exclude '**/ComparableVersion.java' // Apache class used as source-level dep as to not need the hundred+ other classes the library pulls in
exclude '**/ContextualPatch.java' // diff4j single file library
}

application {
Expand Down
8 changes: 4 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ dependencyResolutionManagement.versionCatalogs.register('libs') {

library 'gson', 'com.google.code.gson', 'gson' version '2.10.1'
library 'jopt', 'net.sf.jopt-simple', 'jopt-simple' version '6.0-alpha-3'
library 'jver', 'net.minecraftforge', 'java-provisioner' version '2.0.4'
library 'srgutils', 'net.minecraftforge', 'srgutils' version '0.6.3'
library 'jver', 'net.minecraftforge', 'java-provisioner' version '2.0.5'
library 'srgutils', 'net.minecraftforge', 'srgutils' version '0.6.6'
library 'diff', 'io.codechicken', 'DiffPatch' version '2.0.0.36' // Fuzzy patching

library 'fastcsv', 'de.siegmar', 'fastcsv' version '3.4.0'
library 'commonsio', 'commons-io', 'commons-io' version '2.18.0'

// Utilities
library 'utils-download', 'net.minecraftforge', 'download-utils' version '0.4.0'
library 'utils-download', 'net.minecraftforge', 'download-utils' version '0.4.1'
library 'utils-files', 'net.minecraftforge', 'file-utils' version '0.3.3'
library 'utils-hash', 'net.minecraftforge', 'hash-utils' version '0.2.2'
library 'utils-data', 'net.minecraftforge', 'json-data-utils' version '0.4.7'
library 'utils-data', 'net.minecraftforge', 'json-data-utils' version '0.4.10'
library 'utils-logging', 'net.minecraftforge', 'log-utils' version '0.5.1'
library 'utils-os', 'net.minecraftforge', 'os-utils' version '0.1.0'
bundle 'utils', ['utils-download', 'utils-files', 'utils-hash', 'utils-data', 'utils-logging', 'utils-os']
Expand Down
26 changes: 16 additions & 10 deletions src/main/java/net/minecraftforge/mcmaven/cli/MCPTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import net.minecraftforge.mcmaven.impl.MinecraftMaven;
import net.minecraftforge.mcmaven.impl.cache.Cache;
import net.minecraftforge.mcmaven.impl.mappings.Mappings;
import net.minecraftforge.mcmaven.impl.mappings.ResolvedMappings;
import net.minecraftforge.mcmaven.impl.repo.forge.Patcher;
import net.minecraftforge.mcmaven.impl.repo.mcpconfig.MCP;
import net.minecraftforge.mcmaven.impl.repo.mcpconfig.MCPConfigRepo;
Expand Down Expand Up @@ -197,12 +198,12 @@ static OptionParser run(String[] args, boolean getParser) throws Exception {
Util.filter(LOGGER, " SAS: ", sas);
LOGGER.info();

var task = new MCPTask(outputDir, new Cache(cacheRoot, jdkCacheRoot), artifact, pipeline);
var task = new MCPTask(outputDir, new Cache(cacheRoot, jdkCacheRoot), artifact, pipeline, mappings);
var ret = task.classes();
if(mappings != null)
task.mappings(mappings);
task.mappings();
if (!disableDecompile)
ret = task.decompile(mappings, ats, sas);
ret = task.decompile(ats, sas);
task.data.put("output", ret);

try {
Expand All @@ -222,13 +223,15 @@ static OptionParser run(String[] args, boolean getParser) throws Exception {
private final MCP mcp;
private final MCPSide side;
private final String prefix;
private final ResolvedMappings mappings;

private MCPTask(@Nullable File outputDir, Cache cache, Artifact artifact, String pipeline) {
private MCPTask(@Nullable File outputDir, Cache cache, Artifact artifact, String pipeline, @Nullable Mappings baseMappings) {
this.outputDir = outputDir;

this.repo = new MCPConfigRepo(cache, false);
this.mcp = repo.get(artifact);
this.side = mcp.getSide(pipeline);
this.mappings = baseMappings == null ? null : baseMappings.withContext(side);

this.data.put("config", artifact.toString());
this.data.put("pipeline", pipeline);
Expand All @@ -251,15 +254,15 @@ private String classes() {
return this.data.get("classes.srg");
}

private void mappings(@Nullable Mappings mappings) {
private void mappings() {
this.data.put("mappings.channel", mappings.channel());
this.data.put("mappings.version", mappings.version());
this.data.put("mappings.zip", local(mappings.getCsvZip(side).execute(), prefix + "/mappings.zip"));
this.data.put("mappings.map2obf", local(mappings.getMapped2Obf(side).execute(), prefix + "/mappings.map2obf.tsrg.gz"));
this.data.put("mappings.map2srg", local(mappings.getMapped2Srg(side).execute(), prefix + "/mappings.map2srg.tsrg.gz"));
this.data.put("mappings.zip", local(mappings.getCsvZip().execute(), prefix + "/mappings.zip"));
this.data.put("mappings.map2obf", local(mappings.getMapped2Obf().execute(), prefix + "/mappings.map2obf.tsrg.gz"));
this.data.put("mappings.map2srg", local(mappings.getMapped2Srg().execute(), prefix + "/mappings.map2srg.tsrg.gz"));
}

private String decompile(@Nullable Mappings mappings, List<File> ats, List<File> sas) {
private String decompile(List<File> ats, List<File> sas) {
var sourcesTask = side.getSources();

if (!ats.isEmpty() || !sas.isEmpty()) {
Expand Down Expand Up @@ -299,7 +302,10 @@ private String decompile(@Nullable Mappings mappings, List<File> ats, List<File>
LOGGER.info("Renaming MCP Source Jar");
indent = LOGGER.push();
try {
var renameTask = new RenameTask(side.getBuildFolder(), side.getName(), side, sourcesTask, mappings, false);
var mcVersion = side.getMCP().getMinecraftTasks().getVersion();
var srgTask = side.getTasks().getMappings();

var renameTask = new RenameTask(side.getBuildFolder(), side.getName(), sourcesTask, mappings, false, srgTask, mcVersion);
this.data.put("sources.named", local(renameTask.execute(), prefix + "/sources.named.jar"));
} finally {
LOGGER.pop(indent);
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/net/minecraftforge/mcmaven/cli/MavenTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;

import joptsimple.OptionParser;
Expand Down Expand Up @@ -211,7 +210,6 @@ static OptionParser run(String[] args, boolean getParser) throws Exception {
options.has(globalAuxiliaryVariantsO),
options.has(disableGradleO),
options.has(stubO),
new HashSet<>(),
new ArrayList<>(options.valuesOf(accessTransformerO)),
new ArrayList<>(options.valuesOf(facadeConfigO)),
options.valueOf(outputJsonO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private Mavenizer() { }
private static boolean offline = false;

private static boolean cacheOnly = false;
private static boolean cacheMiss = false;
public static boolean cacheMiss = false;
private static boolean ignoreCache = false;

public static boolean isOffline() {
Expand Down
Loading
Loading