From 7e60be124c61dc740a18ca9ce84847ebb7c2da3a Mon Sep 17 00:00:00 2001 From: benfry Date: Sat, 29 Oct 2011 16:15:17 +0000 Subject: [PATCH] fix library exports to do subfolders, fix structure --- android/todo.txt | 5 ++++ app/src/processing/app/Library.java | 20 +++++++++++-- app/src/processing/mode/java/JavaBuild.java | 33 ++++++++------------- todo.txt | 21 ++++++++----- 4 files changed, 50 insertions(+), 29 deletions(-) diff --git a/android/todo.txt b/android/todo.txt index ed3cc6dc6..ed3d6eb88 100644 --- a/android/todo.txt +++ b/android/todo.txt @@ -1,6 +1,11 @@ 0201 android +_ if a sketch asks for android mode but it's not available +_ (after a double-click) +_ you get the "is android installed"? dialog, then it re-opens again +_ without closing the other + _ remove 'processing.test' package--people are posting on the market w/ it _ Android mode does not recognize library imports _ http://code.google.com/p/processing/issues/detail?id=766 diff --git a/app/src/processing/app/Library.java b/app/src/processing/app/Library.java index 364c37935..2b2aceaa5 100644 --- a/app/src/processing/app/Library.java +++ b/app/src/processing/app/Library.java @@ -37,7 +37,11 @@ public class Library extends InstalledContribution { static public final String propertiesFileName = "library.properties"; - /** Filter to pull out just files and no directories, and to skip export.txt */ + /** + * Filter to pull out just files and none of the platform-specific + * directories, and to skip export.txt. As of 2.0a2, other directories are + * included, because we need things like the 'plugins' subfolder w/ video. + */ static FilenameFilter standardFilter = new FilenameFilter() { public boolean accept(File dir, String name) { // skip .DS_Store files, .svn folders, etc @@ -45,7 +49,19 @@ public class Library extends InstalledContribution { if (name.equals("CVS")) return false; if (name.equals("export.txt")) return false; File file = new File(dir, name); - return (!file.isDirectory()); +// return (!file.isDirectory()); + if (file.isDirectory()) { + if (name.equals("macosx")) return false; + if (name.equals("macosx32")) return false; + if (name.equals("macosx64")) return false; + if (name.equals("windows")) return false; + if (name.equals("windows32")) return false; + if (name.equals("windows64")) return false; + if (name.equals("linux")) return false; + if (name.equals("linux32")) return false; + if (name.equals("linux64")) return false; + } + return true; } }; diff --git a/app/src/processing/mode/java/JavaBuild.java b/app/src/processing/mode/java/JavaBuild.java index 003c03080..122c89b7b 100644 --- a/app/src/processing/mode/java/JavaBuild.java +++ b/app/src/processing/mode/java/JavaBuild.java @@ -1233,20 +1233,10 @@ public class JavaBuild { for (Library library : importedLibraries) { // add each item from the library folder / export list to the output for (File exportFile : library.getApplicationExports(exportPlatform, exportBits)) { +// System.out.println("export: " + exportFile); String exportName = exportFile.getName(); -// String[] exportList = library.getExports(exportPlatform, exportBits); -// for (String item : exportList) { -// for (int i = 0; i < exportList.length; i++) { -// if (exportList[i].equals(".") || -// exportList[i].equals("..")) continue; - -// exportList[i] = PApplet.trim(exportList[i]); -// if (exportList[i].equals("")) continue; - -// File exportFile = new File(libraryFolder, exportList[i]); -// File exportFile = new File(library.getLibraryPath(), ) if (!exportFile.exists()) { - System.err.println("File " + exportFile.getName() + " does not exist"); + System.err.println("File " + exportFile.getName() + " does not exist."); } else if (exportFile.isDirectory()) { //System.err.println("Ignoring sub-folder \"" + exportList[i] + "\""); @@ -1261,19 +1251,22 @@ public class JavaBuild { } else if (exportFile.getName().toLowerCase().endsWith(".zip") || exportFile.getName().toLowerCase().endsWith(".jar")) { - //packClassPathIntoZipFile(exportFile.getAbsolutePath(), zos); -// Base.copyFile(exportFile, new File(jarFolder, exportList[i])); -// jarListVector.add(exportList[i]); Base.copyFile(exportFile, new File(jarFolder, exportName)); jarListVector.add(exportName); - } else if ((exportPlatform == PConstants.MACOSX) && - (exportFile.getName().toLowerCase().endsWith(".jnilib"))) { - // jnilib files can be placed in Contents/Resources/Java +// } else if ((exportPlatform == PConstants.MACOSX) && +// (exportFile.getName().toLowerCase().endsWith(".jnilib"))) { +// // jnilib files can be placed in Contents/Resources/Java +// Base.copyFile(exportFile, new File(jarFolder, exportName)); +// +// } else { +// // copy the file to the main directory.. prolly a .dll or something +// Base.copyFile(exportFile, new File(destFolder, exportName)); +// } + } else if (exportPlatform == PConstants.MACOSX) { Base.copyFile(exportFile, new File(jarFolder, exportName)); - + } else { - // copy the file to the main directory.. prolly a .dll or something Base.copyFile(exportFile, new File(destFolder, exportName)); } } diff --git a/todo.txt b/todo.txt index 0836338f8..07e260084 100644 --- a/todo.txt +++ b/todo.txt @@ -4,11 +4,24 @@ X http://code.google.com/p/processing/issues/detail?id=836 X add movie maker tool to the build scripts X swap order of applet/application in the file menu X update Quaqua to 7.4.2 +X make application the default instead of applet +X subfolders of windows32 & friends aren't being included (gsvideo problem) + +_ add a preferences option for whether to run in 32 or 64-bit +_ also make note of when library is not available (serial) with error msg +_ gsvideo sometimes needs to run as 64 instead of 32 + +_ Commenting via menu or shortcut does not set sketch to "need save" +_ http://code.google.com/p/processing/issues/detail?id=860 + +_ gstreamer has a million DLLs, so it's gross to have them in the main fldr +_ how would launch4j deal with this? _ move Movie Maker out to its own separate tool package _ http://code.google.com/p/processing/issues/detail?id=837 -_ don't show library conflict warning until someone tries to build code +_ don't show library conflict warning until someone tries to build +_ with code that actually calls on one of those packages _ too many people seem to think this is an error _ bad tool brings down the environment @@ -24,8 +37,6 @@ _ also add option for FSEM or not _ library imports failing for libs that define the same packages in 1.5.1 _ http://code.google.com/p/processing/issues/detail?id=725 -_ make application the default instead of applet - _ renaming a normal tab to same name with ".java" fails with ".pde" version already exists _ http://code.google.com/p/processing/issues/detail?id=776 @@ -1255,10 +1266,6 @@ _ need to set dock icon title on osx PDE / Present -_ add option to use full screen exclusive mode on present inside pde? -_ override default setting of macosx (yes) and linux/win (no) -_ http://dev.processing.org/bugs/show_bug.cgi?id=1043 -_ linux present mode isn't working properly _ need to decide how to handle "stop" button in present mode _ http://dev.processing.org/bugs/show_bug.cgi?id=63 _ when running externally, people need to write their own stop function