diff --git a/app/src/processing/mode/java/JavaBuild.java b/app/src/processing/mode/java/JavaBuild.java index aa1fdb83e..d0c1d428d 100644 --- a/app/src/processing/mode/java/JavaBuild.java +++ b/app/src/processing/mode/java/JavaBuild.java @@ -1090,6 +1090,7 @@ public class JavaBuild { return false; } + /* File folder = null; for (String platformName : PConstants.platformNames) { int platform = Base.getPlatformIndex(platformName); @@ -1113,17 +1114,31 @@ public class JavaBuild { } } } + */ + + File folder = null; + String platformName = Base.getPlatformName(); + if (Library.hasMultipleArch(PApplet.platform, importedLibraries)) { + // export the 32-bit version + folder = new File(sketch.getFolder(), "application." + platformName + "32"); + if (!exportApplication(folder, PApplet.platform, 32)) { + return false; + } + // export the 64-bit version + folder = new File(sketch.getFolder(), "application." + platformName + "64"); + if (!exportApplication(folder, PApplet.platform, 64)) { + return false; + } + } else { // just make a single one for this platform + folder = new File(sketch.getFolder(), "application." + platformName); + if (!exportApplication(folder, PApplet.platform, 0)) { + return false; + } + } return true; // all good } -// public boolean exportApplication(String destPath, -// String platformName, -// int exportBits) throws IOException, RunnerException { -// return exportApplication(destPath, Base.getPlatformIndex(platformName), exportBits); -// } - - /** * Export to application without GUI. Also called by the Commander. */ diff --git a/app/src/processing/mode/java/JavaEditor.java b/app/src/processing/mode/java/JavaEditor.java index 38ef50e99..ce81e060e 100644 --- a/app/src/processing/mode/java/JavaEditor.java +++ b/app/src/processing/mode/java/JavaEditor.java @@ -257,27 +257,19 @@ public class JavaEditor extends Editor { panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.add(Box.createVerticalStrut(6)); - //Box panel = Box.createVerticalBox(); - - //Box labelBox = Box.createHorizontalBox(); -// String msg = "Click Export to Application to create a standalone, " + -// "double-clickable application for the selected plaforms."; - -// String msg = "Export to Application creates a standalone, \n" + -// "double-clickable application for the selected plaforms."; String line1 = "Export to Application creates double-clickable,"; - String line2 = "standalone applications for the selected plaforms."; + //String line2 = "standalone applications for the selected plaforms."; + String line2 = "standalone application for the current plaform."; JLabel label1 = new JLabel(line1, SwingConstants.CENTER); JLabel label2 = new JLabel(line2, SwingConstants.CENTER); label1.setAlignmentX(Component.LEFT_ALIGNMENT); label2.setAlignmentX(Component.LEFT_ALIGNMENT); -// label1.setAlignmentX(); -// label2.setAlignmentX(0); panel.add(label1); panel.add(label2); - int wide = label2.getPreferredSize().width; + int wide = label1.getPreferredSize().width; panel.add(Box.createVerticalStrut(12)); + /* final JCheckBox windowsButton = new JCheckBox("Windows"); //windowsButton.setMnemonic(KeyEvent.VK_W); windowsButton.setSelected(Preferences.getBoolean("export.application.platform.windows")); @@ -318,11 +310,9 @@ public class JavaEditor extends Editor { wide = Math.max(wide, platformPanel.getPreferredSize().width); platformPanel.setAlignmentX(Component.LEFT_ALIGNMENT); panel.add(platformPanel); + */ -// Box indentPanel = Box.createHorizontalBox(); -// indentPanel.add(Box.createHorizontalStrut(new JCheckBox().getPreferredSize().width)); final JCheckBox showStopButton = new JCheckBox("Show a Stop button"); - //showStopButton.setMnemonic(KeyEvent.VK_S); showStopButton.setSelected(Preferences.getBoolean("export.application.stop")); showStopButton.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { @@ -331,11 +321,8 @@ public class JavaEditor extends Editor { }); showStopButton.setEnabled(Preferences.getBoolean("export.application.fullscreen")); showStopButton.setBorder(new EmptyBorder(3, 13, 6, 13)); -// indentPanel.add(showStopButton); -// indentPanel.setAlignmentX(Component.LEFT_ALIGNMENT); final JCheckBox fullScreenButton = new JCheckBox("Full Screen (Present mode)"); - //fullscreenButton.setMnemonic(KeyEvent.VK_F); fullScreenButton.setSelected(Preferences.getBoolean("export.application.fullscreen")); fullScreenButton.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { @@ -350,12 +337,9 @@ public class JavaEditor extends Editor { optionPanel.setLayout(new BoxLayout(optionPanel, BoxLayout.Y_AXIS)); optionPanel.add(fullScreenButton); optionPanel.add(showStopButton); -// optionPanel.add(indentPanel); optionPanel.setBorder(new TitledBorder("Options")); - wide = Math.max(wide, platformPanel.getPreferredSize().width); - //goodIdea = new Dimension(wide, optionPanel.getPreferredSize().height); +// wide = Math.max(wide, platformPanel.getPreferredSize().width); optionPanel.setAlignmentX(Component.LEFT_ALIGNMENT); - //optionPanel.setMaximumSize(goodIdea); panel.add(optionPanel); Dimension good; @@ -364,43 +348,20 @@ public class JavaEditor extends Editor { label1.setMaximumSize(good); good = new Dimension(wide, label2.getPreferredSize().height); label2.setMaximumSize(good); - good = new Dimension(wide, platformPanel.getPreferredSize().height); - platformPanel.setMaximumSize(good); +// good = new Dimension(wide, platformPanel.getPreferredSize().height); +// platformPanel.setMaximumSize(good); good = new Dimension(wide, optionPanel.getPreferredSize().height); optionPanel.setMaximumSize(good); -// JPanel actionPanel = new JPanel(); -// optionPanel.setLayout(new BoxLayout(optionPanel, BoxLayout.X_AXIS)); -// optionPanel.add(Box.createHorizontalGlue()); - -// final JDialog frame = new JDialog(editor, "Export to Application"); - -// JButton cancelButton = new JButton("Cancel"); -// cancelButton.addActionListener(new ActionListener() { -// public void actionPerformed(ActionEvent e) { -// frame.dispose(); -// return false; -// } -// }); - - // Add the buttons in platform-specific order -// if (PApplet.platform == PConstants.MACOSX) { -// optionPanel.add(cancelButton); -// optionPanel.add(exportButton); -// } else { -// optionPanel.add(exportButton); -// optionPanel.add(cancelButton); -// } String[] options = { "Export", "Cancel" }; final JOptionPane optionPane = new JOptionPane(panel, JOptionPane.PLAIN_MESSAGE, - //JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION, null, options, options[0]); - final JDialog dialog = new JDialog(this, "Export Options", true); + final JDialog dialog = new JDialog(this, "Export Application", true); dialog.setContentPane(optionPane); optionPane.addPropertyChangeListener(new PropertyChangeListener() { @@ -410,9 +371,8 @@ public class JavaEditor extends Editor { if (dialog.isVisible() && (e.getSource() == optionPane) && (prop.equals(JOptionPane.VALUE_PROPERTY))) { - //If you were going to check something - //before closing the window, you'd do - //it here. + // If you were going to check something before + // closing the window, you'd do it here. dialog.setVisible(false); } } diff --git a/todo.txt b/todo.txt index 53cc4c78f..f5eacdddb 100644 --- a/todo.txt +++ b/todo.txt @@ -194,14 +194,14 @@ _ try installing 10.7.3 on Mac Mini and check whether things run _ make sure it's only running on 64-bit machines? export -_ change how export is handled -_ remove ability to export cross-platform apps -_ add ability to embed the current JRE -_ the case for the embedded JRE -_ https://github.com/processing/processing/issues/2104 -_ change app stub in OS X exported application -_ change Windows export to use launch4j instead of the launcher.cpp file -_ actually call ant from inside p5? +X change app stub in OS X exported application +_ make note re: app export being slower, and resulting app much larger +X change how export is handled +X remove ability to export cross-platform apps +X add ability to embed the current JRE +X only going to embed always... consider option to disable it later +o the case for the embedded JRE +o https://github.com/processing/processing/issues/2104 medium _ use platformDelete() to remove untitled sketches? @@ -219,6 +219,8 @@ _ "String index out of range" error _ https://github.com/processing/processing/issues/1940 _ look through all isPopupTrigger() code _ make sure both press/release are implemented +_ change Windows export to use launch4j instead of the launcher.cpp file +_ actually call ant from inside p5? post 2.1 cleaning _ remove video for macosx32 from the repo permanently