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 checkstyle
This commit is contained in:
		
							parent
							
								
									5ef6125795
								
							
						
					
					
						commit
						705754de80
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		|  | @ -43,6 +43,7 @@ import org.cadixdev.mercury.Mercury; | |||
| import org.gradle.api.Project; | ||||
| import org.gradle.api.artifacts.Configuration; | ||||
| import org.gradle.api.artifacts.Dependency; | ||||
| import org.gradle.api.plugins.BasePluginConvention; | ||||
| 
 | ||||
| import net.fabricmc.loom.providers.MappingsProvider; | ||||
| import net.fabricmc.loom.providers.MinecraftMappedProvider; | ||||
|  | @ -284,8 +285,9 @@ public class LoomGradleExtension { | |||
| 
 | ||||
| 	public String getRefmapName() { | ||||
| 		if (refmapName == null || refmapName.isEmpty()) { | ||||
| 			project.getLogger().warn("Could not find refmap definition, will be using default name: " + project.getName() + "-refmap.json"); | ||||
| 			refmapName = project.getName() + "-refmap.json"; | ||||
| 			String defaultRefmapName = project.getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName() + "-refmap.json"; | ||||
| 			project.getLogger().warn("Could not find refmap definition, will be using default name: " + defaultRefmapName); | ||||
| 			refmapName = defaultRefmapName; | ||||
| 		} | ||||
| 
 | ||||
| 		return refmapName; | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue