diff --git a/processing/app/Sketch.java b/processing/app/Sketch.java index b39cbaaa4..ba82d7007 100644 --- a/processing/app/Sketch.java +++ b/processing/app/Sketch.java @@ -72,6 +72,8 @@ public class Sketch { int hiddenCount; SketchCode hidden[]; + Hashtable zipFileContents; + // all these set each time build() is called String mainClassName; String classPath; @@ -1511,6 +1513,8 @@ public class Sketch { // make sure the user didn't hide the sketch folder ensureExistence(); + zipFileContents = new Hashtable(); + boolean replaceHtml = true; //File appletDir, String exportSketchName, File dataDir) { //String program = textarea.getText(); @@ -1746,6 +1750,8 @@ public class Sketch { } else if (exportFile.getName().toLowerCase().endsWith(".zip") || exportFile.getName().toLowerCase().endsWith(".jar")) { + //System.out.println("adding zip file " + + // exportFile.getAbsolutePath()); packClassPathIntoZipFile(exportFile.getAbsolutePath(), zos); } else { // just copy the file over.. prolly a .dll or something @@ -1862,8 +1868,8 @@ public class Sketch { * Slurps up .class files from a colon (or semicolon on windows) * separated list of paths and adds them to a ZipOutputStream. */ - static public void packClassPathIntoZipFile(String path, - ZipOutputStream zos) + public void packClassPathIntoZipFile(String path, + ZipOutputStream zos) throws IOException { String pieces[] = PApplet.split(path, File.pathSeparatorChar); @@ -1883,10 +1889,15 @@ public class Sketch { // actually 'continue's for all dir entries } else { - String name = entry.getName(); + String entryName = entry.getName(); // ignore contents of the META-INF folders - if (name.indexOf("META-INF") == 0) continue; - ZipEntry entree = new ZipEntry(name); + if (entryName.indexOf("META-INF") == 0) continue; + + // don't allow duplicate entries + if (zipFileContents.get(entryName) != null) continue; + zipFileContents.put(entryName, new Object()); + + ZipEntry entree = new ZipEntry(entryName); zos.putNextEntry(entree); byte buffer[] = new byte[(int) entry.getSize()]; diff --git a/processing/todo.txt b/processing/todo.txt index 8100feb3a..dcad3b4dc 100644 --- a/processing/todo.txt +++ b/processing/todo.txt @@ -58,11 +58,11 @@ _ need to straighten out for when audio comes along _ list of changes since rev 69? run through revisions.txt +_ list of known bugs should be on the faq page +_ a bunch of stuff from revisions.txt on 84 and 82 + _ processing vs. flash item on the faq? a "why?" page? -// - - . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .