1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-13 10:29:35 +01:00

...now Verify works again... (part 2/3)

This commit is contained in:
Cristian Maglie 2016-11-07 17:26:32 +01:00
parent 611ed081b3
commit ae990954d3

View File

@ -22,6 +22,7 @@
package processing.app;
import cc.arduino.Compiler;
import cc.arduino.Constants;
import cc.arduino.UpdatableBoardsLibsFakeURLsHandler;
import cc.arduino.contributions.*;
@ -349,29 +350,40 @@ public class Base {
System.exit(0);
} else if (parser.isVerifyOrUploadMode()) {
splash.close();
// Set verbosity for command line build
PreferencesData.setBoolean("build.verbose", parser.isDoVerboseBuild());
PreferencesData.setBoolean("upload.verbose", parser.isDoVerboseUpload());
// Set preserve-temp flag
PreferencesData.setBoolean("runtime.preserve.temp.files", parser.isPreserveTempFiles());
// Make sure these verbosity preferences are only for the
// current session
// Make sure these verbosity preferences are only for the current session
PreferencesData.setDoSave(false);
Editor editor = editors.get(0);
Sketch sketch = null;
String outputFile = null;
try {
// Build
splash.splashText(tr("Verifying..."));
File sketchFile = new File(parser.getFilenames().get(0));
sketch = new Sketch(sketchFile);
outputFile = new Compiler(sketch).build(progress -> {}, false);
} catch (Exception e) {
// Error during build
System.exit(1);
}
if (parser.isUploadMode()) {
splash.splashText(tr("Verifying and uploading..."));
editor.exportHandler.run();
} else {
splash.splashText(tr("Verifying..."));
editor.runHandler.run();
}
// Error during build or upload
if (editor.status.isErr()) {
System.exit(1);
// XXX: TODO
//editor.exportHandler.run();
// Error during upload
//if (editor.status.isErr()) {
// System.exit(1);
//}
}
// No errors exit gracefully