warn about refmap name after fields are populated, might help some things

dev/0.11
Adrian Siekierka 2018-12-30 12:04:53 +01:00
parent 6a77b5deaa
commit 0dcb7070be
3 changed files with 12 additions and 10 deletions

View File

@ -87,11 +87,6 @@ public class AbstractPlugin implements Plugin<Project> {
configureIDEs(); configureIDEs();
configureCompile(); configureCompile();
if(extension.refmapName == null || extension.refmapName.isEmpty()){
project.getLogger().warn("Could not find refmap definition, will be using default name: " + project.getName() + "-refmap.json");
extension.refmapName = project.getName() + "-refmap.json";
}
Map<Project, Set<Task>> taskMap = project.getAllTasks(true); Map<Project, Set<Task>> taskMap = project.getAllTasks(true);
for (Map.Entry<Project, Set<Task>> entry : taskMap.entrySet()) { for (Map.Entry<Project, Set<Task>> entry : taskMap.entrySet()) {
Project project = entry.getKey(); Project project = entry.getKey();
@ -105,7 +100,7 @@ public class AbstractPlugin implements Plugin<Project> {
try { try {
javaCompileTask.getOptions().getCompilerArgs().add("-AinMapFileNamedIntermediary=" + extension.getMappingsProvider().MAPPINGS_TINY.getCanonicalPath()); javaCompileTask.getOptions().getCompilerArgs().add("-AinMapFileNamedIntermediary=" + extension.getMappingsProvider().MAPPINGS_TINY.getCanonicalPath());
javaCompileTask.getOptions().getCompilerArgs().add("-AoutMapFileNamedIntermediary=" + extension.getMappingsProvider().MAPPINGS_MIXIN_EXPORT.getCanonicalPath()); javaCompileTask.getOptions().getCompilerArgs().add("-AoutMapFileNamedIntermediary=" + extension.getMappingsProvider().MAPPINGS_MIXIN_EXPORT.getCanonicalPath());
javaCompileTask.getOptions().getCompilerArgs().add("-AoutRefMapFile=" + new File(javaCompileTask.getDestinationDir(), extension.refmapName).getCanonicalPath()); javaCompileTask.getOptions().getCompilerArgs().add("-AoutRefMapFile=" + new File(javaCompileTask.getDestinationDir(), extension.getRefmapName()).getCanonicalPath());
javaCompileTask.getOptions().getCompilerArgs().add("-AdefaultObfuscationEnv=named:intermediary"); javaCompileTask.getOptions().getCompilerArgs().add("-AdefaultObfuscationEnv=named:intermediary");
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -216,4 +216,13 @@ public class LoomGradleExtension {
public void setDependencyManager(LoomDependencyManager dependencyManager) { public void setDependencyManager(LoomDependencyManager dependencyManager) {
this.dependencyManager = dependencyManager; this.dependencyManager = dependencyManager;
} }
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";
}
return refmapName;
}
} }

View File

@ -101,11 +101,9 @@ public class ModRemapper {
throw new RuntimeException("Failed to reobfuscate JAR"); throw new RuntimeException("Failed to reobfuscate JAR");
} }
if (extension.refmapName != null && extension.refmapName.length() > 0) { if (MixinRefmapHelper.addRefmapName(extension.getRefmapName(), extension.getMixinJsonVersion(), modJarOutput)) {
if (MixinRefmapHelper.addRefmapName(extension.refmapName, extension.getMixinJsonVersion(), modJarOutput)) {
project.getLogger().debug("Transformed mixin reference maps in output JAR!"); project.getLogger().debug("Transformed mixin reference maps in output JAR!");
} }
}
try { try {
if (modJar.exists()) { if (modJar.exists()) {