Libraries: if missing header files, a lib doesn't even get listed. Fixes #3374

This commit is contained in:
Federico Fissore 2015-06-22 09:19:11 +02:00
parent ee006271d8
commit 6558afa21d
1 changed files with 8 additions and 0 deletions

View File

@ -171,6 +171,10 @@ public class LibrariesIndexer {
// Create a legacy library and exit
LegacyUserLibrary lib = LegacyUserLibrary.create(folder);
lib.setReadOnly(readOnly);
String[] headers = BaseNoGui.headerListFromIncludePath(lib.getSrcFolder());
if (headers.length == 0) {
throw new IOException(lib.getSrcFolder().getAbsolutePath());
}
installedLibraries.addOrReplace(lib);
if (isSketchbook) {
installedLibrariesWithDuplicates.add(lib);
@ -183,6 +187,10 @@ public class LibrariesIndexer {
// Create a regular library
UserLibrary lib = UserLibrary.create(folder);
lib.setReadOnly(readOnly);
String[] headers = BaseNoGui.headerListFromIncludePath(lib.getSrcFolder());
if (headers.length == 0) {
throw new IOException(lib.getSrcFolder().getAbsolutePath());
}
installedLibraries.addOrReplace(lib);
if (isSketchbook) {
installedLibrariesWithDuplicates.add(lib);