Fix mixin mapping being shared between all projects.

dev/0.11
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() { public boolean isShareCaches() {
return shareCaches; 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 // The mappings we use in practice
public File tinyMappings; public File tinyMappings;
public File tinyMappingsJar; public File tinyMappingsJar;
public File mappingsMixinExport;
public MappingsProvider(Project project) { public MappingsProvider(Project project) {
super(project); super(project);
@ -277,7 +276,6 @@ public class MappingsProvider extends DependencyProvider {
private void initFiles() { private void initFiles() {
baseTinyMappings = mappingsDir.resolve(mappingsName + "-tiny-" + minecraftVersion + "-" + mappingsVersion + "-base"); baseTinyMappings = mappingsDir.resolve(mappingsName + "-tiny-" + minecraftVersion + "-" + mappingsVersion + "-base");
mappingsMixinExport = new File(getExtension().getProjectBuildCache(), "mixin-map-" + minecraftVersion + "-" + mappingsVersion + ".tiny");
} }
public void cleanFiles() { public void cleanFiles() {
@ -290,8 +288,6 @@ public class MappingsProvider extends DependencyProvider {
Files.deleteIfExists(baseTinyMappings); Files.deleteIfExists(baseTinyMappings);
} }
mappingsMixinExport.delete();
if (tinyMappings != null) { if (tinyMappings != null) {
tinyMappings.delete(); 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); 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(); Path mixinMapPath = mixinMapFile.toPath();
TinyRemapper.Builder remapperBuilder = TinyRemapper.newRemapper(); TinyRemapper.Builder remapperBuilder = TinyRemapper.newRemapper();
@ -194,7 +194,7 @@ public class RemapJarTask extends Jar {
jarRemapper.addMappings(TinyRemapperMappingsHelper.create(mappingsProvider.getMappings(), fromM, toM, false)); jarRemapper.addMappings(TinyRemapperMappingsHelper.create(mappingsProvider.getMappings(), fromM, toM, false));
} }
File mixinMapFile = mappingsProvider.mappingsMixinExport; File mixinMapFile = extension.getMixinMappings();
Path mixinMapPath = mixinMapFile.toPath(); Path mixinMapPath = mixinMapFile.toPath();
if (mixinMapFile.exists()) { if (mixinMapFile.exists()) {

View File

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