Skip to content

Commit 6558afa

Browse files
author
Federico Fissore
committed
Libraries: if missing header files, a lib doesn't even get listed. Fixes #3374
1 parent ee00627 commit 6558afa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ private void scanLibrary(File folder, boolean isSketchbook) throws IOException {
171171
// Create a legacy library and exit
172172
LegacyUserLibrary lib = LegacyUserLibrary.create(folder);
173173
lib.setReadOnly(readOnly);
174+
String[] headers = BaseNoGui.headerListFromIncludePath(lib.getSrcFolder());
175+
if (headers.length == 0) {
176+
throw new IOException(lib.getSrcFolder().getAbsolutePath());
177+
}
174178
installedLibraries.addOrReplace(lib);
175179
if (isSketchbook) {
176180
installedLibrariesWithDuplicates.add(lib);
@@ -183,6 +187,10 @@ private void scanLibrary(File folder, boolean isSketchbook) throws IOException {
183187
// Create a regular library
184188
UserLibrary lib = UserLibrary.create(folder);
185189
lib.setReadOnly(readOnly);
190+
String[] headers = BaseNoGui.headerListFromIncludePath(lib.getSrcFolder());
191+
if (headers.length == 0) {
192+
throw new IOException(lib.getSrcFolder().getAbsolutePath());
193+
}
186194
installedLibraries.addOrReplace(lib);
187195
if (isSketchbook) {
188196
installedLibrariesWithDuplicates.add(lib);

0 commit comments

Comments
 (0)