arduino/Arduino — pull request #1726 by cmaglie (2013-12-09 00:29:23+00:00)
Title: Include library paths used by libraries in the compiler search path (take 2)

Originally started by @giseburt on #1250

This pull fixes a case where libraries that a sketch uses indirectly (other libraries is uses require them) need to be included directly in order to compile.
It is necessary to #include a library's file in your sketch in order for the IDE to add that library's path to the compiler command line. This patch searches the files that are included as well, adding dependent libraries to the search path. This removes then need to directly #include indirectly used libraries.

It takes into account also Matthijs suggestion:
* Reuse include extraction from preprocessor
* Recursively find dependencies (libA that uses libB that uses libC)

Moreover:
* I added a "resolvedDependency" field in Library class to store libraries dependencies.
* I see that we should inspect also .c/.cpp files to search for dependencies, only .h headers sometimes are not sufficient.
* The "importToLibraryTable" was moved into a LibraryResolver for convenience.
* I've left a debug message that shows all the "detected" dependencies at startup, it will be removed when merged.
* The patch is structured to be easily adapted to whatever changes we decide to make to 1.5 lib format.

BTW, I'm still not fully convinced about this patch, more tests welcome.

C