Apply BuildDependentLibraries to src_filter dirs #696
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At the moment BuildDependentLibraries (scanning source files for lib
includes) is only executed for the src directory, even if src_filter
brings in other directories. This few lines of code changes apply the
scanning to all additional dirs mentioned in src_filter with a "+".
Use cases
Have targets in your platformio.ini which references additional source directories via the src_filter.
In my case i want to target an arduino and an esp8266 board. The core logic
of my library is platform independant but some few files are board specific, so I need
to pull them in via src_filter (which works great). This pull request allows mentioned
libraries in those additional files to be handled like if the source files reside in "src/".
If you provide some examples with a library, at the moment it is difficult to provide the user
a simple way to build an example. With this pull request the user just builds one of the
targets in the platformio.ini which lists the example source files via src_filter. E.g.:
`[platformio]
src_dir = src/
[env:nodemcuv2lib]
platform = espressif
framework = arduino
board = nodemcuv2
[env:nodemcuv2Example1]
platform = espressif
framework = arduino
board = nodemcuv2
src_filter = +<> +<../examples/example1/src/>`