bug fixing and cleaning up

This commit is contained in:
benfry
2011-01-29 22:38:32 +00:00
parent dae66d3a2d
commit 101f5bd879
4 changed files with 34 additions and 17 deletions

View File

@@ -225,15 +225,15 @@ class AndroidBuild extends JavaBuild {
}
public boolean exportProject() throws IOException, SketchException {
public File exportProject() throws IOException, SketchException {
File projectFolder = build("debug");
if (projectFolder == null) {
return false;
return null;
}
File exportFolder = createExportFolder();
Base.copyDir(projectFolder, exportFolder);
return true;
return exportFolder;
}

View File

@@ -35,6 +35,7 @@ import processing.app.Mode;
import processing.app.SketchException;
import processing.core.PApplet;
import processing.mode.java.JavaEditor;
import processing.mode.java.JavaToolbar;
// http://dl.google.com/android/repository/repository.xml
// http://dl.google.com/android/android-sdk_r3-mac.zip
@@ -355,15 +356,28 @@ public class AndroidEditor extends JavaEditor {
* If users want a debug build, they can do that from the command line.
*/
public void handleExportProject() {
AndroidBuild build = new AndroidBuild(sketch, amode);
try {
if (build.exportProject()) {
statusNotice("Done with export.");
}
} catch (IOException e) {
statusError(e);
} catch (SketchException e) {
statusError(e);
if (handleExportCheckModified()) {
new Thread() {
public void run() {
toolbar.activate(AndroidToolbar.EXPORT);
startIndeterminate();
statusNotice("Exporting a debug version of the sketch...");
AndroidBuild build = new AndroidBuild(sketch, amode);
try {
File exportFolder = build.exportProject();
if (exportFolder != null) {
Base.openFolder(exportFolder);
statusNotice("Done with export.");
}
} catch (IOException e) {
statusError(e);
} catch (SketchException e) {
statusError(e);
}
stopIndeterminate();
toolbar.deactivate(AndroidToolbar.EXPORT);
}
}.start();
}
// try {

View File

@@ -84,7 +84,7 @@ public class AndroidRunner implements DeviceListener {
} else {
listener.statusError("Could not start the sketch.");
}
listener.stopIndeterminate();
lastRunDevice = device;
//} finally {
// build.cleanup();
@@ -273,7 +273,7 @@ public class AndroidRunner implements DeviceListener {
}
}
// called by AndroidMode.handleStop()...
public void close() {
if (lastRunDevice != null) {
@@ -284,6 +284,7 @@ public class AndroidRunner implements DeviceListener {
// sketch stopped on the device
public void sketchStopped() {
listener.stopIndeterminate();
listener.statusHalt();
}
}