1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Merge branch 'ide-1.5.x-fail-when-no-platform-txt' of https://github.com/ffissore/Arduino into ide-1.5.x

This commit is contained in:
Cristian Maglie
2015-01-14 17:19:11 +01:00
3 changed files with 46 additions and 109 deletions

View File

@ -1426,8 +1426,8 @@ public class Editor extends JFrame implements RunnerListener {
public void resetHandlers() {
runHandler = new DefaultRunHandler();
presentHandler = new DefaultPresentHandler();
runHandler = new BuildHandler();
presentHandler = new BuildHandler(true);
stopHandler = new DefaultStopHandler();
exportHandler = new DefaultExportHandler();
exportAppHandler = new DefaultExportAppHandler();
@ -1917,30 +1917,28 @@ public class Editor extends JFrame implements RunnerListener {
new Thread(verbose ? presentHandler : runHandler).start();
}
// DAM: in Arduino, this is compile
class DefaultRunHandler implements Runnable {
public void run() {
try {
sketch.prepare();
sketch.build(false);
statusNotice(_("Done compiling."));
} catch (Exception e) {
status.unprogress();
statusError(e);
}
class BuildHandler implements Runnable {
status.unprogress();
toolbar.deactivate(EditorToolbar.RUN);
private final boolean verbose;
public BuildHandler() {
this(false);
}
}
// DAM: in Arduino, this is compile (with verbose output)
class DefaultPresentHandler implements Runnable {
public BuildHandler(boolean verbose) {
this.verbose = verbose;
}
@Override
public void run() {
try {
sketch.prepare();
sketch.build(true);
sketch.build(verbose);
statusNotice(_("Done compiling."));
} catch (PreferencesMapException e) {
statusError(I18n.format(
_("Error while compiling: missing '{0}' configuration parameter"),
e.getMessage()));
} catch (Exception e) {
status.unprogress();
statusError(e);
@ -1953,11 +1951,8 @@ public class Editor extends JFrame implements RunnerListener {
class DefaultStopHandler implements Runnable {
public void run() {
try {
// DAM: we should try to kill the compilation or upload process here.
} catch (Exception e) {
statusError(e);
}
// TODO
// DAM: we should try to kill the compilation or upload process here.
}
}

View File

@ -29,6 +29,7 @@ import processing.app.debug.Compiler.ProgressListener;
import processing.app.debug.RunnerException;
import processing.app.forms.PasswordAuthorizationDialog;
import processing.app.helpers.OSUtils;
import processing.app.helpers.PreferencesMapException;
import processing.app.packages.Library;
import static processing.app.I18n._;
@ -1129,7 +1130,7 @@ public class Sketch {
* @return null if compilation failed, main class name if not
* @throws RunnerException
*/
public String build(boolean verbose) throws RunnerException {
public String build(boolean verbose) throws RunnerException, PreferencesMapException {
return build(tempBuildFolder.getAbsolutePath(), verbose);
}
@ -1142,7 +1143,7 @@ public class Sketch {
*
* @return null if compilation failed, main class name if not
*/
public String build(String buildPath, boolean verbose) throws RunnerException {
public String build(String buildPath, boolean verbose) throws RunnerException, PreferencesMapException {
// run the preprocessor
editor.status.progressUpdate(20);