1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-20 21:01:25 +03:00

Re-enabled 'Fat' library detection (with a better method)

This commit is contained in:
Cristian Maglie
2012-10-24 17:19:18 +02:00
parent 8cc080fbd9
commit e7193ac42c

View File

@ -1067,8 +1067,6 @@ public class Base {
} }
/** /**
* <b>XXX FAT lib detection temporary disabled: compatibility issues arised.</b><br/>
* <br />
* Scans inside a "FAT" (multi-platform) library folder to see if it contains * Scans inside a "FAT" (multi-platform) library folder to see if it contains
* a version suitable for the actual selected architecture. If a suitable * a version suitable for the actual selected architecture. If a suitable
* version is found the folder containing that version is returned, otherwise * version is found the folder containing that version is returned, otherwise
@ -1081,25 +1079,10 @@ public class Base {
* @return * @return
*/ */
public File scanFatLibrary(File libFolder) { public File scanFatLibrary(File libFolder) {
// A library is considered "fat" if there are folders besides // A library is considered "fat" if it contains a file called
// examples and utility // "library.properties"
boolean fat = false; File libraryPropFile = new File(libFolder, "library.properties");
String[] folders = libFolder.list(new OnlyDirs()); if (!libraryPropFile.exists() || !libraryPropFile.isFile())
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)
return libFolder; return libFolder;
// Search for a subfolder for actual architecture, return null if not found // Search for a subfolder for actual architecture, return null if not found