Fix mixin mapping being shared between all projects.

This commit is contained in:
modmuss50 2020-09-04 22:41:11 +01:00
parent 545b0c946b
commit 20be96e733
4 changed files with 7 additions and 7 deletions

View file

@ -399,4 +399,8 @@ public class LoomGradleExtension {
public boolean isShareCaches() {
return shareCaches;
}
public File getMixinMappings() {
return new File(getProjectBuildCache(), "mixin-map-" + getMinecraftProvider().getMinecraftVersion() + "-" + getMappingsProvider().mappingsVersion + ".tiny");
}
}

View file

@ -76,7 +76,6 @@ public class MappingsProvider extends DependencyProvider {
// The mappings we use in practice
public File tinyMappings;
public File tinyMappingsJar;
public File mappingsMixinExport;
public MappingsProvider(Project project) {
super(project);
@ -277,7 +276,6 @@ public class MappingsProvider extends DependencyProvider {
private void initFiles() {
baseTinyMappings = mappingsDir.resolve(mappingsName + "-tiny-" + minecraftVersion + "-" + mappingsVersion + "-base");
mappingsMixinExport = new File(getExtension().getProjectBuildCache(), "mixin-map-" + minecraftVersion + "-" + mappingsVersion + ".tiny");
}
public void cleanFiles() {
@ -290,8 +288,6 @@ public class MappingsProvider extends DependencyProvider {
Files.deleteIfExists(baseTinyMappings);
}
mappingsMixinExport.delete();
if (tinyMappings != null) {
tinyMappings.delete();
}

View file

@ -99,7 +99,7 @@ public class RemapJarTask extends Jar {
);
Path[] classpath = classpathFiles.stream().map(File::toPath).filter((p) -> !input.equals(p) && Files.exists(p)).toArray(Path[]::new);
File mixinMapFile = mappingsProvider.mappingsMixinExport;
File mixinMapFile = extension.getMixinMappings();
Path mixinMapPath = mixinMapFile.toPath();
TinyRemapper.Builder remapperBuilder = TinyRemapper.newRemapper();
@ -194,7 +194,7 @@ public class RemapJarTask extends Jar {
jarRemapper.addMappings(TinyRemapperMappingsHelper.create(mappingsProvider.getMappings(), fromM, toM, false));
}
File mixinMapFile = mappingsProvider.mappingsMixinExport;
File mixinMapFile = extension.getMixinMappings();
Path mixinMapPath = mixinMapFile.toPath();
if (mixinMapFile.exists()) {

View file

@ -73,7 +73,7 @@ public abstract class AnnotationProcessorInvoker<T extends Task> {
LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class);
Map<String, String> args = new HashMap<String, String>() {{
put("inMapFileNamedIntermediary", extension.getMappingsProvider().tinyMappings.getCanonicalPath());
put("outMapFileNamedIntermediary", extension.getMappingsProvider().mappingsMixinExport.getCanonicalPath());
put("outMapFileNamedIntermediary", extension.getMixinMappings().getCanonicalPath());
put("outRefMapFile", getRefmapDestination(task, extension));
put("defaultObfuscationEnv", "named:intermediary");
}};