Skip to content

Commit 390cd49

Browse files
committed
Basic support for export of unsigned release builds
1 parent d829658 commit 390cd49

File tree

2 files changed

+31
-24
lines changed

2 files changed

+31
-24
lines changed

src/processing/mode/android/AndroidBuild.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,21 +267,17 @@ public File exportProject() throws IOException, SketchException {
267267
return null;
268268
}
269269

270-
271-
public boolean exportPackage() throws IOException, SketchException {
270+
public File exportPackage() throws IOException, SketchException {
272271
File projectFolder = build("release");
273-
if (projectFolder == null) {
274-
return false;
275-
}
272+
if(projectFolder == null) return null;
276273

277274
// TODO all the signing magic needs to happen here
278275

279276
File exportFolder = createExportFolder();
280277
Base.copyDir(projectFolder, exportFolder);
281-
return true;
278+
return new File(exportFolder, "/bin/");
282279
}
283280

284-
285281
/*
286282
// SDK tools 17 have a problem where 'dex' won't pick up the libs folder
287283
// (which contains our friend processing-core.jar) unless your current

src/processing/mode/android/AndroidEditor.java

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,16 @@
2121

2222
package processing.mode.android;
2323

24+
import processing.app.*;
25+
import processing.core.PApplet;
26+
import processing.mode.java.JavaEditor;
27+
28+
import javax.swing.*;
2429
import java.awt.event.ActionEvent;
2530
import java.awt.event.ActionListener;
2631
import java.io.File;
2732
import java.io.IOException;
2833

29-
import javax.swing.JMenu;
30-
import javax.swing.JMenuItem;
31-
32-
import processing.app.*;
33-
import processing.mode.java.JavaEditor;
34-
35-
import processing.core.PApplet;
36-
3734

3835
public class AndroidEditor extends JavaEditor {
3936
private AndroidMode androidMode;
@@ -376,17 +373,31 @@ public void run() {
376373
public void handleExportPackage() {
377374
// Need to implement an entire signing setup first
378375
// http://dev.processing.org/bugs/show_bug.cgi?id=1430
379-
statusError("Exporting signed packages is not yet implemented.");
380376
deactivateExport();
381377

382-
// make a release build
383-
// try {
384-
// buildReleaseForExport("release");
385-
// } catch (final MonitorCanceled ok) {
386-
// statusNotice("Canceled.");
387-
// } finally {
388-
// deactivateExport();
389-
// }
378+
if(handleExportCheckModified()) {
379+
new Thread() {
380+
public void run() {
381+
startIndeterminate();
382+
statusNotice("Exporting signed package...");
383+
AndroidBuild build = new AndroidBuild(sketch, androidMode);
384+
try {
385+
File projectFolder = build.exportPackage();
386+
if(projectFolder != null) {
387+
statusNotice("Done with export.");
388+
Base.openFolder(projectFolder);
389+
} else {
390+
statusError("Error with export");
391+
}
392+
} catch (IOException e) {
393+
statusError(e);
394+
} catch (SketchException e) {
395+
statusError(e);
396+
}
397+
stopIndeterminate();
398+
}
399+
}.start();
400+
}
390401

391402
// TODO now sign it... lots of fun signing code mess to go here. yay!
392403

0 commit comments

Comments
 (0)