From e7193ac42cd36888d745fc31ba0dfe1a2ecd3a4f Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 24 Oct 2012 17:19:18 +0200 Subject: [PATCH] Re-enabled 'Fat' library detection (with a better method) --- app/src/processing/app/Base.java | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 00800871d..64ca0c9d3 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1067,8 +1067,6 @@ public class Base { } /** - * XXX FAT lib detection temporary disabled: compatibility issues arised.
- *
* Scans inside a "FAT" (multi-platform) library folder to see if it contains * a version suitable for the actual selected architecture. If a suitable * version is found the folder containing that version is returned, otherwise @@ -1081,27 +1079,12 @@ public class Base { * @return */ public File scanFatLibrary(File libFolder) { - // A library is considered "fat" if there are folders besides - // examples and utility - boolean fat = false; - String[] folders = libFolder.list(new OnlyDirs()); - for (String folder : folders) { - if (folder.equalsIgnoreCase("examples")) - continue; - if (folder.equalsIgnoreCase("utility")) - continue; - fat = true; - break; - } - - // XXX: Temporary override "FAT" (multiplatform) library detection. - // Compatibility issues arised: many library uses additional folders - // https://code.google.com/p/arduino/issues/detail?id=1079 - fat = false; - - if (!fat) + // A library is considered "fat" if it contains a file called + // "library.properties" + File libraryPropFile = new File(libFolder, "library.properties"); + if (!libraryPropFile.exists() || !libraryPropFile.isFile()) return libFolder; - + // Search for a subfolder for actual architecture, return null if not found File archSubfolder = new File(libFolder, Base.getTargetPlatform().getName()); if (!archSubfolder.exists() || !archSubfolder.isDirectory())