diff --git a/editor/Processing Plugin for Eclipse/feature.xml b/editor/Processing Plugin for Eclipse/feature.xml index 2a60da974..0451a3060 100644 --- a/editor/Processing Plugin for Eclipse/feature.xml +++ b/editor/Processing Plugin for Eclipse/feature.xml @@ -2,7 +2,7 @@ @@ -48,6 +48,9 @@ All images are included under a creative commons license (http://creativecommons + + + * This will prepend the system's path separator so that it can be directly * appended to another path string. - * + *

* This function doesn't bother checking to see if there are any .class * files in the folder or within a subfolder. */ static public String contentsToClassPath(File folder) { - //TODO Review this method and make sure that it is returning only paths directly to jars and zip files - // It was returning empty paths which was breaking things. Needs to be reviewed. if (folder == null) return ""; if (!folder.isDirectory()) return ""; diff --git a/editor/processing.plugin.ui/META-INF/MANIFEST.MF b/editor/processing.plugin.ui/META-INF/MANIFEST.MF index de51cf70f..037d4bb39 100644 --- a/editor/processing.plugin.ui/META-INF/MANIFEST.MF +++ b/editor/processing.plugin.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Processing Plugin User Interface Elements Bundle-SymbolicName: processing.plugin.ui;singleton:=true -Bundle-Version: 0.2.0.0 +Bundle-Version: 0.2.1.0 Bundle-Activator: processing.plugin.ui.ProcessingPlugin Bundle-Vendor: Processing.org Require-Bundle: org.eclipse.ui, diff --git a/editor/processing.plugin.ui/src/processing/plugin/ui/wizards/ExportAsAppletSelectProjectsWizardPage.java b/editor/processing.plugin.ui/src/processing/plugin/ui/wizards/ExportAsAppletSelectProjectsWizardPage.java index 8a969b5d2..19e4fc733 100644 --- a/editor/processing.plugin.ui/src/processing/plugin/ui/wizards/ExportAsAppletSelectProjectsWizardPage.java +++ b/editor/processing.plugin.ui/src/processing/plugin/ui/wizards/ExportAsAppletSelectProjectsWizardPage.java @@ -158,10 +158,10 @@ public class ExportAsAppletSelectProjectsWizardPage extends WizardPage { projectTable.setLabelProvider(new ProjectTableLabelProvider()); final FormData formData = new FormData(); - formData.bottom = new FormAttachment(100,0); - formData.right = new FormAttachment(100,0); - formData.top = new FormAttachment(0,0); - formData.left = new FormAttachment(0,0); + formData.bottom = new FormAttachment(95,0); + formData.right = new FormAttachment(95,0); + formData.top = new FormAttachment(5,0); + formData.left = new FormAttachment(5,0); final Table table = projectTable.getTable(); table.setLayoutData(formData); diff --git a/editor/processing.plugin.ui/src/processing/plugin/ui/wizards/ExportAsAppletWizard.java b/editor/processing.plugin.ui/src/processing/plugin/ui/wizards/ExportAsAppletWizard.java index 1d8abdfc9..43f0b7d40 100644 --- a/editor/processing.plugin.ui/src/processing/plugin/ui/wizards/ExportAsAppletWizard.java +++ b/editor/processing.plugin.ui/src/processing/plugin/ui/wizards/ExportAsAppletWizard.java @@ -20,6 +20,7 @@ import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; @@ -108,32 +109,29 @@ public class ExportAsAppletWizard extends Wizard implements IExportWizard { IFile code = sp.getMainFile(); if (code == null) return false; - // true to nuke the folder contents, if they exist - IFolder exportFolder = sp.getAppletFolder(true); + IFolder exportFolder = sp.getAppletFolder(true); // true to nuke the folder contents, if they exist - // if the code folder has stuff, move it to the applet folder + // add the contents of the code folder to the jar IFolder codeFolder = sp.getCodeFolder(); - if(codeFolder != null){ + if (codeFolder != null){ try{ - String includes = Utilities.contentsToClassPath(codeFolder.getFullPath().toFile()); - String[] codeList = Utilities.splitTokens(includes,File.separator); - for (String path : codeList){ - System.out.println("Found file: " + path + "."); - if (path.toLowerCase().endsWith(".jar") || - path.toLowerCase().endsWith(".zip")) { - IFile exportFile = codeFolder.getFile(new Path(path)); - if (exportFile.isAccessible()){ - exportFile.copy(exportFolder.getFullPath(), true, null); - System.out.println("Copied the file to " + exportFolder.getFullPath().toString() + " ."); - } - } - } - } catch (CoreException e) { - ProcessingLog.logError("Could not export. CoreException while packaging the code folder.", e); - return false; + for(IResource r : codeFolder.members()){ + if(!(r instanceof IFile)) continue; + if(r.getName().startsWith(".")) continue; + if ("jar".equalsIgnoreCase(r.getFileExtension()) || + "zip".equalsIgnoreCase(r.getFileExtension())){ + r.copy(exportFolder.getFullPath().append(r.getName()), true, null); + //System.out.println("Copied the file to " + exportFolder.getFullPath().toString() + " ."); + } + } + } catch (CoreException e){ + ProcessingLog.logError("Code Folder entries could not be included in export." + + "Export for " + sp.getProject().getName() + " may not function properly.", e); } } - //// + + + // Get the compiled source and package it as a jar // Shell parentShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); // JarPackageData codePackageData = new JarPackageData(); // codePackageData.setJarLocation(sp.getAppletFolder().getFullPath().append(sp.getProject().getName() + ".jar")); @@ -150,8 +148,8 @@ public class ExportAsAppletWizard extends Wizard implements IExportWizard { // } -// int wide = this.getWidth(); -// int high = this.getHeight(); +// int wide = sp.getWidth(); +// int high = sp.getHeight(); // // String codeContents = Utilities.readFile(code); // diff --git a/editor/processing.plugin.updateSite/site.xml b/editor/processing.plugin.updateSite/site.xml index fd41602ef..5372a59f6 100644 --- a/editor/processing.plugin.updateSite/site.xml +++ b/editor/processing.plugin.updateSite/site.xml @@ -3,6 +3,9 @@ + + + Provides integration for the Processing programming language to the Eclipse platform. See http://www.processing.org to learn more.