Add null check to refmap location

This commit is contained in:
modmuss50 2016-10-23 18:47:06 +01:00
parent e274d0c8c5
commit ac8087f1c7
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82

View file

@ -105,6 +105,10 @@ public class AbstractPlugin implements Plugin<Project> {
javaCompileTask.getOptions().getCompilerArgs().add("-AinMapFilePomfMojang=" + Constants.MAPPINGS_TINY.get(extension).getCanonicalPath());
javaCompileTask.getOptions().getCompilerArgs().add("-AoutMapFilePomfMojang=" + Constants.MAPPINGS_MIXIN_EXPORT.get(extension).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());
} catch (IOException e) {
e.printStackTrace();