Merge changes #3
@@ -47,12 +47,14 @@ public class JarMergeAction {
|
|||||||
|
|
||||||
// File Inputs
|
// File Inputs
|
||||||
@Setter private File forgeInput;
|
@Setter private File forgeInput;
|
||||||
|
@Setter private File neoforgeInput;
|
||||||
@Setter private File fabricInput;
|
@Setter private File fabricInput;
|
||||||
@Setter private File quiltInput;
|
@Setter private File quiltInput;
|
||||||
private final Map<FusionerExtension.CustomConfiguration, File> customInputs;
|
private final Map<FusionerExtension.CustomConfiguration, File> customInputs;
|
||||||
|
|
||||||
// Relocations
|
// Relocations
|
||||||
@Setter private Map<String, String> forgeRelocations;
|
@Setter private Map<String, String> forgeRelocations;
|
||||||
|
@Setter private Map<String, String> neoforgeRelocations;
|
||||||
@Setter private Map<String, String> fabricRelocations;
|
@Setter private Map<String, String> fabricRelocations;
|
||||||
@Setter private Map<String, String> quiltRelocations;
|
@Setter private Map<String, String> quiltRelocations;
|
||||||
|
|
||||||
@@ -93,7 +95,7 @@ public class JarMergeAction {
|
|||||||
FileTools.createOrReCreate(tempDir);
|
FileTools.createOrReCreate(tempDir);
|
||||||
|
|
||||||
// Check if the required input files exists
|
// Check if the required input files exists
|
||||||
if (forgeInput == null && fabricInput == null && quiltInput == null && customInputs.isEmpty()) {
|
if (forgeInput == null && neoforgeInput == null && fabricInput == null && quiltInput == null && customInputs.isEmpty()) {
|
||||||
throw new IllegalArgumentException("No input jars were provided.");
|
throw new IllegalArgumentException("No input jars were provided.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,6 +103,10 @@ public class JarMergeAction {
|
|||||||
logger.warn("Forge jar does not exist! You can ignore this warning if you are not using forge");
|
logger.warn("Forge jar does not exist! You can ignore this warning if you are not using forge");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (modFusionerExtension.getNeoforgeConfiguration() != null && !FileTools.exists(neoforgeInput)) {
|
||||||
|
logger.warn("NeoForge jar does not exist! You can ignore this warning if you are not using neoforge");
|
||||||
|
}
|
||||||
|
|
||||||
if (modFusionerExtension.getFabricConfiguration() != null && !FileTools.exists(fabricInput)) {
|
if (modFusionerExtension.getFabricConfiguration() != null && !FileTools.exists(fabricInput)) {
|
||||||
logger.warn("Fabric jar does not exist! You can ignore this warning if you are not using fabric");
|
logger.warn("Fabric jar does not exist! You can ignore this warning if you are not using fabric");
|
||||||
}
|
}
|
||||||
@@ -121,6 +127,7 @@ public class JarMergeAction {
|
|||||||
// Create the temporary processing directories
|
// Create the temporary processing directories
|
||||||
File fabricTemp = FileTools.getOrCreate(new File(tempDir, "fabric-temp"));
|
File fabricTemp = FileTools.getOrCreate(new File(tempDir, "fabric-temp"));
|
||||||
File forgeTemp = FileTools.getOrCreate(new File(tempDir, "forge-temp"));
|
File forgeTemp = FileTools.getOrCreate(new File(tempDir, "forge-temp"));
|
||||||
|
File neoforgeTemp = FileTools.getOrCreate(new File(tempDir, "neoforge-temp"));
|
||||||
File quiltTemp = FileTools.getOrCreate(new File(tempDir, "quilt-temp"));
|
File quiltTemp = FileTools.getOrCreate(new File(tempDir, "quilt-temp"));
|
||||||
|
|
||||||
customTemps = new HashMap<>();
|
customTemps = new HashMap<>();
|
||||||
@@ -138,6 +145,9 @@ public class JarMergeAction {
|
|||||||
if (FileTools.exists(forgeInput)) {
|
if (FileTools.exists(forgeInput)) {
|
||||||
jarManager.unpackJar(forgeInput, forgeTemp);
|
jarManager.unpackJar(forgeInput, forgeTemp);
|
||||||
}
|
}
|
||||||
|
if (FileTools.exists(neoforgeInput)) {
|
||||||
|
jarManager.unpackJar(neoforgeInput, neoforgeTemp);
|
||||||
|
}
|
||||||
if (FileTools.exists(fabricInput)) {
|
if (FileTools.exists(fabricInput)) {
|
||||||
jarManager.unpackJar(fabricInput, fabricTemp);
|
jarManager.unpackJar(fabricInput, fabricTemp);
|
||||||
}
|
}
|
||||||
@@ -156,9 +166,10 @@ public class JarMergeAction {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
File mergedTemp = FileTools.getOrCreate(new File(tempDir, "merged-temp"));
|
File mergedTemp = FileTools.getOrCreate(new File(tempDir, "merged-temp"));
|
||||||
processManifests(mergedTemp, forgeTemp, fabricTemp, quiltTemp);
|
processManifests(mergedTemp, forgeTemp, neoforgeTemp, fabricTemp, quiltTemp);
|
||||||
|
|
||||||
FileTools.moveDirectory(forgeTemp, mergedTemp);
|
FileTools.moveDirectory(forgeTemp, mergedTemp);
|
||||||
|
FileTools.moveDirectory(neoforgeTemp, mergedTemp);
|
||||||
FileTools.moveDirectory(fabricTemp, mergedTemp);
|
FileTools.moveDirectory(fabricTemp, mergedTemp);
|
||||||
FileTools.moveDirectory(quiltTemp, mergedTemp);
|
FileTools.moveDirectory(quiltTemp, mergedTemp);
|
||||||
|
|
||||||
@@ -211,6 +222,7 @@ public class JarMergeAction {
|
|||||||
logger.lifecycle("Start processing input jars");
|
logger.lifecycle("Start processing input jars");
|
||||||
|
|
||||||
remapJar(forgeInput, "forge", forgeRelocations);
|
remapJar(forgeInput, "forge", forgeRelocations);
|
||||||
|
remapJar(neoforgeInput, "neoforge", neoforgeRelocations);
|
||||||
remapJar(fabricInput, "fabric", fabricRelocations);
|
remapJar(fabricInput, "fabric", fabricRelocations);
|
||||||
remapJar(quiltInput, "quilt", quiltRelocations);
|
remapJar(quiltInput, "quilt", quiltRelocations);
|
||||||
|
|
||||||
@@ -265,6 +277,9 @@ public class JarMergeAction {
|
|||||||
case "forge":
|
case "forge":
|
||||||
forgeInput = remappedJar;
|
forgeInput = remappedJar;
|
||||||
break;
|
break;
|
||||||
|
case "neoforge":
|
||||||
|
neoforgeInput = remappedJar;
|
||||||
|
break;
|
||||||
case "fabric":
|
case "fabric":
|
||||||
fabricInput = remappedJar;
|
fabricInput = remappedJar;
|
||||||
break;
|
break;
|
||||||
@@ -319,13 +334,15 @@ public class JarMergeAction {
|
|||||||
/**
|
/**
|
||||||
* Process resource files from unpacked jars to remap them to their new package names
|
* Process resource files from unpacked jars to remap them to their new package names
|
||||||
* @param forgeTemps - The forge processing directory
|
* @param forgeTemps - The forge processing directory
|
||||||
|
* @param neoforgeTemps - The neoforge processing directory
|
||||||
* @param fabricTemps - The fabric processing directory
|
* @param fabricTemps - The fabric processing directory
|
||||||
* @param quiltTemps - The quilt processing directory
|
* @param quiltTemps - The quilt processing directory
|
||||||
* @throws IOException - Thrown if an IO error occurs
|
* @throws IOException - Thrown if an IO error occurs
|
||||||
*/
|
*/
|
||||||
private void remapResources(File forgeTemps, File fabricTemps, File quiltTemps) throws IOException {
|
private void remapResources(File forgeTemps, File neoforgeTemps, File fabricTemps, File quiltTemps) throws IOException {
|
||||||
logger.lifecycle("Start Remapping Resources");
|
logger.lifecycle("Start Remapping Resources");
|
||||||
remapJarResources(forgeInput, "forge", forgeTemps, forgeRelocations);
|
remapJarResources(forgeInput, "forge", forgeTemps, forgeRelocations);
|
||||||
|
remapJarResources(neoforgeInput, "neoforge", neoforgeTemps, neoforgeRelocations);
|
||||||
remapJarResources(fabricInput, "fabric", fabricTemps, fabricRelocations);
|
remapJarResources(fabricInput, "fabric", fabricTemps, fabricRelocations);
|
||||||
remapJarResources(quiltInput, "quilt", quiltTemps, quiltRelocations);
|
remapJarResources(quiltInput, "quilt", quiltTemps, quiltRelocations);
|
||||||
|
|
||||||
@@ -341,7 +358,7 @@ public class JarMergeAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remap resource files from jar. Used to remove duplicate code from {@link JarMergeAction#remapResources(File, File, File)}
|
* Remap resource files from jar. Used to remove duplicate code from {@link JarMergeAction#remapResources(File, File, File, File)}
|
||||||
* @param jar - The jar file being processed
|
* @param jar - The jar file being processed
|
||||||
* @param identifier - The group identifier of the packages
|
* @param identifier - The group identifier of the packages
|
||||||
* @param workingDir - The processing directory
|
* @param workingDir - The processing directory
|
||||||
@@ -418,13 +435,15 @@ public class JarMergeAction {
|
|||||||
* Process the manifest files from all the input jars and combine them into one
|
* Process the manifest files from all the input jars and combine them into one
|
||||||
* @param mergedTemp - The processing directory
|
* @param mergedTemp - The processing directory
|
||||||
* @param forgeTemp - The forge processing directory
|
* @param forgeTemp - The forge processing directory
|
||||||
|
* @param neoforgeTemp - The neoforge processing directory
|
||||||
* @param fabricTemp - The fabric processing directory
|
* @param fabricTemp - The fabric processing directory
|
||||||
* @param quiltTemp - The quilt processing directory
|
* @param quiltTemp - The quilt processing directory
|
||||||
* @throws IOException - Thrown if an IO error occurs
|
* @throws IOException - Thrown if an IO error occurs
|
||||||
*/
|
*/
|
||||||
public void processManifests(File mergedTemp, File forgeTemp, File fabricTemp, File quiltTemp) throws IOException {
|
public void processManifests(File mergedTemp, File forgeTemp, File neoforgeTemp, File fabricTemp, File quiltTemp) throws IOException {
|
||||||
Manifest mergedManifest = new Manifest();
|
Manifest mergedManifest = new Manifest();
|
||||||
Manifest forgeManifest = new Manifest();
|
Manifest forgeManifest = new Manifest();
|
||||||
|
Manifest neoforgeManifest = new Manifest();
|
||||||
Manifest fabricManifest = new Manifest();
|
Manifest fabricManifest = new Manifest();
|
||||||
Manifest quiltManifest = new Manifest();
|
Manifest quiltManifest = new Manifest();
|
||||||
List<Manifest> customManifests = new ArrayList<>();
|
List<Manifest> customManifests = new ArrayList<>();
|
||||||
@@ -432,6 +451,8 @@ public class JarMergeAction {
|
|||||||
FileInputStream fileInputStream = null;
|
FileInputStream fileInputStream = null;
|
||||||
if (FileTools.exists(forgeInput)) forgeManifest.read(fileInputStream = new FileInputStream(new File(forgeTemp, "META-INF/MANIFEST.MF")));
|
if (FileTools.exists(forgeInput)) forgeManifest.read(fileInputStream = new FileInputStream(new File(forgeTemp, "META-INF/MANIFEST.MF")));
|
||||||
if (fileInputStream != null) fileInputStream.close();
|
if (fileInputStream != null) fileInputStream.close();
|
||||||
|
if (FileTools.exists(neoforgeInput)) neoforgeManifest.read(fileInputStream = new FileInputStream(new File(neoforgeTemp, "META-INF/MANIFEST.MF")));
|
||||||
|
if (fileInputStream != null) fileInputStream.close();
|
||||||
if (FileTools.exists(fabricInput)) fabricManifest.read(fileInputStream = new FileInputStream(new File(fabricTemp, "META-INF/MANIFEST.MF")));
|
if (FileTools.exists(fabricInput)) fabricManifest.read(fileInputStream = new FileInputStream(new File(fabricTemp, "META-INF/MANIFEST.MF")));
|
||||||
if (fileInputStream != null) fileInputStream.close();
|
if (fileInputStream != null) fileInputStream.close();
|
||||||
if (FileTools.exists(quiltInput)) quiltManifest.read(fileInputStream = new FileInputStream(new File(quiltTemp, "META-INF/MANIFEST.MF")));
|
if (FileTools.exists(quiltInput)) quiltManifest.read(fileInputStream = new FileInputStream(new File(quiltTemp, "META-INF/MANIFEST.MF")));
|
||||||
@@ -449,6 +470,7 @@ public class JarMergeAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
forgeManifest.getMainAttributes().forEach((key, value) -> mergedManifest.getMainAttributes().putValue(key.toString(), value.toString()));
|
forgeManifest.getMainAttributes().forEach((key, value) -> mergedManifest.getMainAttributes().putValue(key.toString(), value.toString()));
|
||||||
|
neoforgeManifest.getMainAttributes().forEach((key, value) -> mergedManifest.getMainAttributes().putValue(key.toString(), value.toString()));
|
||||||
fabricManifest.getMainAttributes().forEach((key, value) -> mergedManifest.getMainAttributes().putValue(key.toString(), value.toString()));
|
fabricManifest.getMainAttributes().forEach((key, value) -> mergedManifest.getMainAttributes().putValue(key.toString(), value.toString()));
|
||||||
quiltManifest.getMainAttributes().forEach((key, value) -> mergedManifest.getMainAttributes().putValue(key.toString(), value.toString()));
|
quiltManifest.getMainAttributes().forEach((key, value) -> mergedManifest.getMainAttributes().putValue(key.toString(), value.toString()));
|
||||||
|
|
||||||
@@ -483,7 +505,7 @@ public class JarMergeAction {
|
|||||||
if (!forgeMixins.isEmpty()) mergedManifest.getMainAttributes().putValue("MixinConfigs", String.join(",", this.forgeMixins));
|
if (!forgeMixins.isEmpty()) mergedManifest.getMainAttributes().putValue("MixinConfigs", String.join(",", this.forgeMixins));
|
||||||
}
|
}
|
||||||
|
|
||||||
remapResources(forgeTemp, fabricTemp, quiltTemp);
|
remapResources(forgeTemp, neoforgeTemp, fabricTemp, quiltTemp);
|
||||||
|
|
||||||
if (this.forgeMixins != null && mergedManifest.getMainAttributes().getValue("MixinConfigs") == null) {
|
if (this.forgeMixins != null && mergedManifest.getMainAttributes().getValue("MixinConfigs") == null) {
|
||||||
logger.debug("Couldn't detect forge mixins. You can ignore this if you are not using mixins with forge.\n" +
|
logger.debug("Couldn't detect forge mixins. You can ignore this if you are not using mixins with forge.\n" +
|
||||||
@@ -499,6 +521,7 @@ public class JarMergeAction {
|
|||||||
//mergedManifest.getMainAttributes().putValue(manifestVersionKey, version);
|
//mergedManifest.getMainAttributes().putValue(manifestVersionKey, version);
|
||||||
|
|
||||||
if (FileTools.exists(forgeInput)) new File(forgeTemp, "META-INF/MANIFEST.MF").delete();
|
if (FileTools.exists(forgeInput)) new File(forgeTemp, "META-INF/MANIFEST.MF").delete();
|
||||||
|
if (FileTools.exists(neoforgeInput)) new File(neoforgeTemp, "META-INF/MANIFEST.MF").delete();
|
||||||
if (FileTools.exists(fabricInput)) new File(fabricTemp, "META-INF/MANIFEST.MF").delete();
|
if (FileTools.exists(fabricInput)) new File(fabricTemp, "META-INF/MANIFEST.MF").delete();
|
||||||
if (FileTools.exists(quiltInput)) new File(quiltTemp, "META-INF/MANIFEST.MF").delete();
|
if (FileTools.exists(quiltInput)) new File(quiltTemp, "META-INF/MANIFEST.MF").delete();
|
||||||
|
|
||||||
@@ -533,6 +556,11 @@ public class JarMergeAction {
|
|||||||
removeDuplicateRelocationResources.put("forge/" + duplicatePath, duplicatePath);
|
removeDuplicateRelocationResources.put("forge/" + duplicatePath, duplicatePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FileTools.exists(neoforgeInput)) {
|
||||||
|
ignoredDuplicateRelocations.put("neoforge." + duplicate, duplicate);
|
||||||
|
removeDuplicateRelocationResources.put("neoforge/" + duplicatePath, duplicatePath);
|
||||||
|
}
|
||||||
|
|
||||||
if (FileTools.exists(fabricInput)) {
|
if (FileTools.exists(fabricInput)) {
|
||||||
ignoredDuplicateRelocations.put("fabric." + duplicate, duplicate);
|
ignoredDuplicateRelocations.put("fabric." + duplicate, duplicate);
|
||||||
removeDuplicateRelocationResources.put("fabric/" + duplicatePath, duplicatePath);
|
removeDuplicateRelocationResources.put("fabric/" + duplicatePath, duplicatePath);
|
||||||
|
@@ -12,9 +12,11 @@ package com.hypherionmc.modfusioner.plugin;
|
|||||||
import groovy.lang.Closure;
|
import groovy.lang.Closure;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.gradle.api.Action;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public class FusionerExtension {
|
public class FusionerExtension {
|
||||||
|
|
||||||
// Group, or package names that will be used for the final jar
|
// Group, or package names that will be used for the final jar
|
||||||
@@ -42,6 +44,10 @@ public class FusionerExtension {
|
|||||||
@Getter @Setter
|
@Getter @Setter
|
||||||
FusionerExtension.ForgeConfiguration forgeConfiguration;
|
FusionerExtension.ForgeConfiguration forgeConfiguration;
|
||||||
|
|
||||||
|
// Forge Project Configuration
|
||||||
|
@Getter @Setter
|
||||||
|
FusionerExtension.NeoForgeConfiguration neoforgeConfiguration;
|
||||||
|
|
||||||
// Fabric Project Configuration
|
// Fabric Project Configuration
|
||||||
@Getter @Setter
|
@Getter @Setter
|
||||||
FusionerExtension.FabricConfiguration fabricConfiguration;
|
FusionerExtension.FabricConfiguration fabricConfiguration;
|
||||||
@@ -109,6 +115,15 @@ public class FusionerExtension {
|
|||||||
return forgeConfiguration;
|
return forgeConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set up the neoforge project configurations
|
||||||
|
*/
|
||||||
|
public FusionerExtension.NeoForgeConfiguration neoforge(Closure<NeoForgeConfiguration> closure) {
|
||||||
|
neoforgeConfiguration = new FusionerExtension.NeoForgeConfiguration();
|
||||||
|
ModFusionerPlugin.rootProject.configure(neoforgeConfiguration, closure);
|
||||||
|
return neoforgeConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up the fabric project configurations
|
* Set up the fabric project configurations
|
||||||
*/
|
*/
|
||||||
@@ -184,6 +199,37 @@ public class FusionerExtension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NeoForge Configuration Structure
|
||||||
|
*/
|
||||||
|
public static class NeoForgeConfiguration {
|
||||||
|
|
||||||
|
// The name of the gradle module that contains the fabric code
|
||||||
|
@Getter @Setter
|
||||||
|
String projectName = "neoforge";
|
||||||
|
|
||||||
|
// The file that will be used as the input
|
||||||
|
@Getter @Setter
|
||||||
|
String inputFile;
|
||||||
|
|
||||||
|
// The name of the task to run to get the input file
|
||||||
|
@Getter @Setter
|
||||||
|
String inputTaskName;
|
||||||
|
|
||||||
|
// Packages that should be relocated, instead of duplicated
|
||||||
|
@Getter
|
||||||
|
Map<String, String> relocations = new HashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a package to relocate, instead of duplicating
|
||||||
|
* @param from - The original name of the package. For example: com.google.gson
|
||||||
|
* @param to - The new name of the package. For example: forge.com.google.gson
|
||||||
|
*/
|
||||||
|
public void addRelocate(String from, String to) {
|
||||||
|
this.relocations.put(from, to);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fabric project configuration
|
* Fabric project configuration
|
||||||
*/
|
*/
|
||||||
|
@@ -72,6 +72,7 @@ public class JarFuseTask extends Jar {
|
|||||||
|
|
||||||
// Get settings from extension
|
// Get settings from extension
|
||||||
FusionerExtension.ForgeConfiguration forgeConfiguration = modFusionerExtension.getForgeConfiguration();
|
FusionerExtension.ForgeConfiguration forgeConfiguration = modFusionerExtension.getForgeConfiguration();
|
||||||
|
FusionerExtension.NeoForgeConfiguration neoforgeConfiguration = modFusionerExtension.getNeoforgeConfiguration();
|
||||||
FusionerExtension.FabricConfiguration fabricConfiguration = modFusionerExtension.getFabricConfiguration();
|
FusionerExtension.FabricConfiguration fabricConfiguration = modFusionerExtension.getFabricConfiguration();
|
||||||
FusionerExtension.QuiltConfiguration quiltConfiguration = modFusionerExtension.getQuiltConfiguration();
|
FusionerExtension.QuiltConfiguration quiltConfiguration = modFusionerExtension.getQuiltConfiguration();
|
||||||
|
|
||||||
@@ -79,6 +80,7 @@ public class JarFuseTask extends Jar {
|
|||||||
|
|
||||||
// Try to resolve the projects specific in the extension config
|
// Try to resolve the projects specific in the extension config
|
||||||
Project forgeProject = null;
|
Project forgeProject = null;
|
||||||
|
Project neoforgeProject = null;
|
||||||
Project fabricProject = null;
|
Project fabricProject = null;
|
||||||
Project quiltProject = null;
|
Project quiltProject = null;
|
||||||
Map<Project, FusionerExtension.CustomConfiguration> customProjects = new HashMap<>();
|
Map<Project, FusionerExtension.CustomConfiguration> customProjects = new HashMap<>();
|
||||||
@@ -91,6 +93,13 @@ public class JarFuseTask extends Jar {
|
|||||||
} catch (NoSuchElementException ignored) { }
|
} catch (NoSuchElementException ignored) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (neoforgeConfiguration != null) {
|
||||||
|
try {
|
||||||
|
neoforgeProject = rootProject.getAllprojects().stream().filter(p -> !p.getName().equals(rootProject.getName())).filter(p -> p.getName().equalsIgnoreCase(neoforgeConfiguration.getProjectName())).findFirst().get();
|
||||||
|
validation.add(true);
|
||||||
|
} catch (NoSuchElementException ignored) { }
|
||||||
|
}
|
||||||
|
|
||||||
if (fabricConfiguration != null) {
|
if (fabricConfiguration != null) {
|
||||||
try {
|
try {
|
||||||
fabricProject = rootProject.getAllprojects().stream().filter(p -> !p.getName().equals(rootProject.getName())).filter(p -> p.getName().equalsIgnoreCase(fabricConfiguration.getProjectName())).findFirst().get();
|
fabricProject = rootProject.getAllprojects().stream().filter(p -> !p.getName().equals(rootProject.getName())).filter(p -> p.getName().equalsIgnoreCase(fabricConfiguration.getProjectName())).findFirst().get();
|
||||||
@@ -124,6 +133,7 @@ public class JarFuseTask extends Jar {
|
|||||||
|
|
||||||
// Try to automatically determine the input jar from the projects
|
// Try to automatically determine the input jar from the projects
|
||||||
File forgeJar = null;
|
File forgeJar = null;
|
||||||
|
File neoforgeJar = null;
|
||||||
File fabricJar = null;
|
File fabricJar = null;
|
||||||
File quiltJar = null;
|
File quiltJar = null;
|
||||||
Map<FusionerExtension.CustomConfiguration, File> customJars = new HashMap<>();
|
Map<FusionerExtension.CustomConfiguration, File> customJars = new HashMap<>();
|
||||||
@@ -132,6 +142,10 @@ public class JarFuseTask extends Jar {
|
|||||||
forgeJar = getInputFile(forgeConfiguration.getInputFile(), forgeConfiguration.getInputTaskName(), forgeProject);
|
forgeJar = getInputFile(forgeConfiguration.getInputFile(), forgeConfiguration.getInputTaskName(), forgeProject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (neoforgeProject != null && neoforgeConfiguration != null) {
|
||||||
|
neoforgeJar = getInputFile(neoforgeConfiguration.getInputFile(), neoforgeConfiguration.getInputTaskName(), neoforgeProject);
|
||||||
|
}
|
||||||
|
|
||||||
if (fabricProject != null && fabricConfiguration != null) {
|
if (fabricProject != null && fabricConfiguration != null) {
|
||||||
fabricJar = getInputFile(fabricConfiguration.getInputFile(), fabricConfiguration.getInputTaskName(), fabricProject);
|
fabricJar = getInputFile(fabricConfiguration.getInputFile(), fabricConfiguration.getInputTaskName(), fabricProject);
|
||||||
}
|
}
|
||||||
@@ -164,6 +178,10 @@ public class JarFuseTask extends Jar {
|
|||||||
mergeAction.setForgeRelocations(forgeConfiguration == null ? new HashMap<>() : forgeConfiguration.getRelocations());
|
mergeAction.setForgeRelocations(forgeConfiguration == null ? new HashMap<>() : forgeConfiguration.getRelocations());
|
||||||
mergeAction.setForgeMixins(forgeConfiguration == null ? new ArrayList<>() : forgeConfiguration.getMixins());
|
mergeAction.setForgeMixins(forgeConfiguration == null ? new ArrayList<>() : forgeConfiguration.getMixins());
|
||||||
|
|
||||||
|
// NeoForge
|
||||||
|
mergeAction.setNeoforgeInput(neoforgeJar);
|
||||||
|
mergeAction.setNeoforgeRelocations(neoforgeConfiguration == null ? new HashMap<>() : neoforgeConfiguration.getRelocations());
|
||||||
|
|
||||||
// Fabric
|
// Fabric
|
||||||
mergeAction.setFabricInput(fabricJar);
|
mergeAction.setFabricInput(fabricJar);
|
||||||
mergeAction.setFabricRelocations(fabricConfiguration == null ? new HashMap<>() : fabricConfiguration.getRelocations());
|
mergeAction.setFabricRelocations(fabricConfiguration == null ? new HashMap<>() : fabricConfiguration.getRelocations());
|
||||||
|
Reference in New Issue
Block a user