Skip to content

Linux: Removed X11 requirement when running in command line mode #5578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Nov 25, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
...now Verify works again... (part 2/3)
  • Loading branch information
cmaglie committed Nov 25, 2016
commit ae990954d3b67feef79140f85a5c9e90a61f85cc
36 changes: 24 additions & 12 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

package processing.app;

import cc.arduino.Compiler;
import cc.arduino.Constants;
import cc.arduino.UpdatableBoardsLibsFakeURLsHandler;
import cc.arduino.contributions.*;
Expand Down Expand Up @@ -349,31 +350,42 @@ public Base(String[] args) throws Exception {
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());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps changing set to setBoolean should end up in a separate commit?


// 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;

if (parser.isUploadMode()) {
splash.splashText(tr("Verifying and uploading..."));
editor.exportHandler.run();
} else {
try {
// Build
splash.splashText(tr("Verifying..."));
editor.runHandler.run();
}

// Error during build or upload
if (editor.status.isErr()) {
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..."));
// XXX: TODO
//editor.exportHandler.run();
// Error during upload
//if (editor.status.isErr()) {
// System.exit(1);
//}
}

// No errors exit gracefully
System.exit(0);
} else if (parser.isGuiMode()) {
Expand Down