cease loading the same mappings file a million times

This commit is contained in:
Adrian Siekierka
2019-04-24 19:32:35 +02:00
parent b5b3138e24
commit f768f9316e
8 changed files with 96 additions and 29 deletions

View File

@@ -44,6 +44,7 @@ import org.gradle.jvm.JvmLibrary;
import org.gradle.language.base.artifact.SourcesArtifact;
import java.io.File;
import java.io.IOException;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
@@ -116,7 +117,11 @@ public class ModCompileRemapper {
File output = new File(modStore, remappedFilename + ".jar");
if (!output.exists() || input.lastModified() <= 0 || input.lastModified() > output.lastModified()) {
//If the output doesn't exist, or appears to be outdated compared to the input we'll remap it
ModProcessor.handleMod(input, output, project);
try {
ModProcessor.handleMod(input, output, project);
} catch (IOException e) {
throw new RuntimeException("Failed to remap mod", e);
}
if (!output.exists()){
throw new RuntimeException("Failed to remap mod");