Skip to content

Commit e7193ac

Browse files
committed
Re-enabled 'Fat' library detection (with a better method)
1 parent 8cc080f commit e7193ac

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

app/src/processing/app/Base.java

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,8 +1067,6 @@ public Map<String, File> scanLibraries(File folder) {
10671067
}
10681068

10691069
/**
1070-
* <b>XXX FAT lib detection temporary disabled: compatibility issues arised.</b><br/>
1071-
* <br />
10721070
* Scans inside a "FAT" (multi-platform) library folder to see if it contains
10731071
* a version suitable for the actual selected architecture. If a suitable
10741072
* version is found the folder containing that version is returned, otherwise
@@ -1081,27 +1079,12 @@ public Map<String, File> scanLibraries(File folder) {
10811079
* @return
10821080
*/
10831081
public File scanFatLibrary(File libFolder) {
1084-
// A library is considered "fat" if there are folders besides
1085-
// examples and utility
1086-
boolean fat = false;
1087-
String[] folders = libFolder.list(new OnlyDirs());
1088-
for (String folder : folders) {
1089-
if (folder.equalsIgnoreCase("examples"))
1090-
continue;
1091-
if (folder.equalsIgnoreCase("utility"))
1092-
continue;
1093-
fat = true;
1094-
break;
1095-
}
1096-
1097-
// XXX: Temporary override "FAT" (multiplatform) library detection.
1098-
// Compatibility issues arised: many library uses additional folders
1099-
// https://code.google.com/p/arduino/issues/detail?id=1079
1100-
fat = false;
1101-
1102-
if (!fat)
1082+
// A library is considered "fat" if it contains a file called
1083+
// "library.properties"
1084+
File libraryPropFile = new File(libFolder, "library.properties");
1085+
if (!libraryPropFile.exists() || !libraryPropFile.isFile())
11031086
return libFolder;
1104-
1087+
11051088
// Search for a subfolder for actual architecture, return null if not found
11061089
File archSubfolder = new File(libFolder, Base.getTargetPlatform().getName());
11071090
if (!archSubfolder.exists() || !archSubfolder.isDirectory())

0 commit comments

Comments
 (0)