mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-14 11:29:26 +01:00
...now Verify works again... (part 2/3)
This commit is contained in:
parent
611ed081b3
commit
ae990954d3
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
package processing.app;
|
package processing.app;
|
||||||
|
|
||||||
|
import cc.arduino.Compiler;
|
||||||
import cc.arduino.Constants;
|
import cc.arduino.Constants;
|
||||||
import cc.arduino.UpdatableBoardsLibsFakeURLsHandler;
|
import cc.arduino.UpdatableBoardsLibsFakeURLsHandler;
|
||||||
import cc.arduino.contributions.*;
|
import cc.arduino.contributions.*;
|
||||||
@ -349,29 +350,40 @@ public class Base {
|
|||||||
System.exit(0);
|
System.exit(0);
|
||||||
|
|
||||||
} else if (parser.isVerifyOrUploadMode()) {
|
} else if (parser.isVerifyOrUploadMode()) {
|
||||||
splash.close();
|
|
||||||
// Set verbosity for command line build
|
// Set verbosity for command line build
|
||||||
PreferencesData.setBoolean("build.verbose", parser.isDoVerboseBuild());
|
PreferencesData.setBoolean("build.verbose", parser.isDoVerboseBuild());
|
||||||
PreferencesData.setBoolean("upload.verbose", parser.isDoVerboseUpload());
|
PreferencesData.setBoolean("upload.verbose", parser.isDoVerboseUpload());
|
||||||
|
|
||||||
|
// Set preserve-temp flag
|
||||||
PreferencesData.setBoolean("runtime.preserve.temp.files", parser.isPreserveTempFiles());
|
PreferencesData.setBoolean("runtime.preserve.temp.files", parser.isPreserveTempFiles());
|
||||||
|
|
||||||
// Make sure these verbosity preferences are only for the
|
// Make sure these verbosity preferences are only for the current session
|
||||||
// current session
|
|
||||||
PreferencesData.setDoSave(false);
|
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()) {
|
if (parser.isUploadMode()) {
|
||||||
splash.splashText(tr("Verifying and uploading..."));
|
splash.splashText(tr("Verifying and uploading..."));
|
||||||
editor.exportHandler.run();
|
// XXX: TODO
|
||||||
} else {
|
//editor.exportHandler.run();
|
||||||
splash.splashText(tr("Verifying..."));
|
// Error during upload
|
||||||
editor.runHandler.run();
|
//if (editor.status.isErr()) {
|
||||||
}
|
// System.exit(1);
|
||||||
|
//}
|
||||||
// Error during build or upload
|
|
||||||
if (editor.status.isErr()) {
|
|
||||||
System.exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// No errors exit gracefully
|
// No errors exit gracefully
|
||||||
|
Loading…
x
Reference in New Issue
Block a user