|
21 | 21 |
|
22 | 22 | package processing.mode.android;
|
23 | 23 |
|
| 24 | +import processing.app.*; |
| 25 | +import processing.core.PApplet; |
| 26 | +import processing.mode.java.JavaEditor; |
| 27 | + |
| 28 | +import javax.swing.*; |
24 | 29 | import java.awt.event.ActionEvent;
|
25 | 30 | import java.awt.event.ActionListener;
|
26 | 31 | import java.io.File;
|
27 | 32 | import java.io.IOException;
|
28 | 33 |
|
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 |
| - |
37 | 34 |
|
38 | 35 | public class AndroidEditor extends JavaEditor {
|
39 | 36 | private AndroidMode androidMode;
|
@@ -376,17 +373,31 @@ public void run() {
|
376 | 373 | public void handleExportPackage() {
|
377 | 374 | // Need to implement an entire signing setup first
|
378 | 375 | // http://dev.processing.org/bugs/show_bug.cgi?id=1430
|
379 |
| - statusError("Exporting signed packages is not yet implemented."); |
380 | 376 | deactivateExport();
|
381 | 377 |
|
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 | + } |
390 | 401 |
|
391 | 402 | // TODO now sign it... lots of fun signing code mess to go here. yay!
|
392 | 403 |
|
|
0 commit comments