Use a root of library when filtering source code using library.json and srcFilter field

This commit is contained in:
Ivan Kravets
2017-06-29 21:22:44 +03:00
parent 46774466db
commit 94a834ecc4
2 changed files with 12 additions and 0 deletions

View File

@ -7,6 +7,9 @@ PlatformIO 3.0
3.4.1 (2017-??-??)
~~~~~~~~~~~~~~~~~~
* Use a root of library when filtering source code using
`library.json <http://docs.platformio.org/page/librarymanager/config.html>`__
and ``srcFilter`` field
* Do not ask for board ID when initialize project for desktop platform
* Fixed issue when can not load broken PIO Core state

View File

@ -521,6 +521,15 @@ class PlatformIOLibBuilder(LibBuilderBase):
def _is_arduino_manifest(self):
return isfile(join(self.path, "library.properties"))
@property
def src_dir(self):
if all([
"srcFilter" in self._manifest.get("build", {}) or
self.env['SRC_FILTER'], not self._is_arduino_manifest()
]):
return self.path
return LibBuilderBase.src_dir.fget(self)
@property
def src_filter(self):
if "srcFilter" in self._manifest.get("build", {}):