Compiler: don't merge if bootloader file is specified but missing. Print a warning instead. Fixes #3394

This commit is contained in:
Federico Fissore 2015-06-22 11:11:09 +02:00
parent 8e76fb87dc
commit 978c8fc682
1 changed files with 7 additions and 3 deletions

View File

@ -1198,15 +1198,19 @@ public class Compiler implements MessageConsumer {
return null;
}
File mergedSketch = new File(buildPath, className + ".with_bootloader.hex");
FileUtils.copyFile(sketch, mergedSketch);
String bootloaderNoBlink = prefs.get("bootloader.noblink");
if (bootloaderNoBlink == null) {
bootloaderNoBlink = prefs.get("bootloader.file");
}
File bootloader = new File(new File(prefs.get("build.platform.path"), "bootloaders"), bootloaderNoBlink);
if (!bootloader.exists()) {
System.err.println(I18n.format(_("Bootloader file specified but missing: {0}"), bootloader));
return null;
}
File mergedSketch = new File(buildPath, className + ".with_bootloader.hex");
FileUtils.copyFile(sketch, mergedSketch);
new MergeSketchWithBooloader().merge(mergedSketch, bootloader);