Improve support for old mbed libraries without manifest

This commit is contained in:
Ivan Kravets
2018-01-24 14:56:44 +02:00
parent c0b277d9c8
commit de523493b2
2 changed files with 18 additions and 0 deletions

View File

@ -4,6 +4,12 @@ Release Notes
PlatformIO 3.0
--------------
3.5.2 (2018-??-??)
~~~~~~~~~~~~~~~~~~
* Handle "os.mbed.com" URL as Mercurial (hg) repository
* Improved support for old mbed libraries without manifest
3.5.1 (2018-01-18)
~~~~~~~~~~~~~~~~~~

View File

@ -516,8 +516,20 @@ class MbedLibBuilder(LibBuilderBase):
include_dirs = LibBuilderBase.get_include_dirs(self)
if self.path not in include_dirs:
include_dirs.append(self.path)
# library with module.json
for p in self._manifest.get("extraIncludes", []):
include_dirs.append(join(self.path, p))
# old mbed library without manifest, add to CPPPATH all folders
if not self._manifest:
for root, _, __ in os.walk(self.path):
part = root.replace(self.path, "").lower()
if any(s in part for s in ("%s." % sep, "test", "example")):
continue
if root not in include_dirs:
include_dirs.append(root)
return include_dirs
def is_frameworks_compatible(self, frameworks):