Change mixin refmap default name to use archivesBaseName instead of the project name (#158)
* Change mixin refmap default name to use archivesBaseName instead of the project name Using the project name can be problematic in libraries pulled in with Jitpack. Jitpack clones projects in a directory called "build", which sets the project name to "build" if not manually defined. The resulting refmap, "build-refmap.json", can conflict with other mods' refmaps, leading to mixin crashes. * Shut up checkstyledev/0.11
parent
5ef6125795
commit
705754de80
|
@ -43,6 +43,7 @@ import org.cadixdev.mercury.Mercury;
|
||||||
import org.gradle.api.Project;
|
import org.gradle.api.Project;
|
||||||
import org.gradle.api.artifacts.Configuration;
|
import org.gradle.api.artifacts.Configuration;
|
||||||
import org.gradle.api.artifacts.Dependency;
|
import org.gradle.api.artifacts.Dependency;
|
||||||
|
import org.gradle.api.plugins.BasePluginConvention;
|
||||||
|
|
||||||
import net.fabricmc.loom.providers.MappingsProvider;
|
import net.fabricmc.loom.providers.MappingsProvider;
|
||||||
import net.fabricmc.loom.providers.MinecraftMappedProvider;
|
import net.fabricmc.loom.providers.MinecraftMappedProvider;
|
||||||
|
@ -284,8 +285,9 @@ public class LoomGradleExtension {
|
||||||
|
|
||||||
public String getRefmapName() {
|
public String getRefmapName() {
|
||||||
if (refmapName == null || refmapName.isEmpty()) {
|
if (refmapName == null || refmapName.isEmpty()) {
|
||||||
project.getLogger().warn("Could not find refmap definition, will be using default name: " + project.getName() + "-refmap.json");
|
String defaultRefmapName = project.getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName() + "-refmap.json";
|
||||||
refmapName = project.getName() + "-refmap.json";
|
project.getLogger().warn("Could not find refmap definition, will be using default name: " + defaultRefmapName);
|
||||||
|
refmapName = defaultRefmapName;
|
||||||
}
|
}
|
||||||
|
|
||||||
return refmapName;
|
return refmapName;
|
||||||
|
|
Loading…
Reference in New Issue