This commit is contained in:
asie
2018-12-12 07:10:30 +01:00
parent 0f51d2142f
commit b00b42e3bf
5 changed files with 30 additions and 9 deletions

View File

@@ -84,6 +84,11 @@ public class AbstractPlugin implements Plugin<Project> {
configureIDEs();
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);
for (Map.Entry<Project, Set<Task>> entry : taskMap.entrySet()) {
Project project = entry.getKey();
@@ -97,10 +102,6 @@ public class AbstractPlugin implements Plugin<Project> {
try {
javaCompileTask.getOptions().getCompilerArgs().add("-AinMapFileNamedIntermediary=" + extension.getMappingsProvider().MAPPINGS_TINY.getCanonicalPath());
javaCompileTask.getOptions().getCompilerArgs().add("-AoutMapFileNamedIntermediary=" + extension.getMappingsProvider().MAPPINGS_MIXIN_EXPORT.getCanonicalPath());
if(extension.refmapName == null || extension.refmapName.isEmpty()){
project.getLogger().error("Could not find refmap definition, will be using default name: " + project.getName() + "-refmap.json");
extension.refmapName = project.getName() + "-refmap.json";
}
javaCompileTask.getOptions().getCompilerArgs().add("-AoutRefMapFile=" + new File(javaCompileTask.getDestinationDir(), extension.refmapName).getCanonicalPath());
javaCompileTask.getOptions().getCompilerArgs().add("-AdefaultObfuscationEnv=named:intermediary");
} catch (IOException e) {
@@ -233,6 +234,9 @@ public class AbstractPlugin implements Plugin<Project> {
remapJarTask.doLast(task -> project1.getArtifacts().add("archives", remapJarTask.jar));
remapJarTask.dependsOn(project1.getTasks().getByName("jar"));
project1.getTasks().getByName("build").dependsOn(remapJarTask);
} else {
AbstractArchiveTask jarTask = (AbstractArchiveTask) project1.getTasks().getByName("jar");
extension.addUnmappedMod(jarTask.getArchivePath());
}
});
}