mirror of
https://github.com/processing/processing4.git
synced 2026-02-04 06:09:17 +01:00
bug fixing and cleaning up
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user