forked from platformio/platformio-core
Fix an issue with incorrect detecting of compatibility (LDF) between generic library and Arduino or ARM mbed frameworks
This commit is contained in:
@ -13,6 +13,8 @@ PlatformIO 3.0
|
|||||||
(`issue #1674 <https://github.com/platformio/platformio-core/issues/1674>`_)
|
(`issue #1674 <https://github.com/platformio/platformio-core/issues/1674>`_)
|
||||||
- CLion: Improved project portability using "${CMAKE_CURRENT_LIST_DIR}" instead of full path
|
- CLion: Improved project portability using "${CMAKE_CURRENT_LIST_DIR}" instead of full path
|
||||||
|
|
||||||
|
* Fixed an issue with incorrect detecting of compatibility (LDF) between generic library and Arduino or ARM mbed frameworks
|
||||||
|
|
||||||
3.6.3 (2018-12-12)
|
3.6.3 (2018-12-12)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ from __future__ import absolute_import
|
|||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
from glob import glob
|
from glob import glob
|
||||||
from os.path import (basename, commonprefix, dirname, isdir, isfile, join,
|
from os.path import (basename, commonprefix, dirname, isdir, isfile, join,
|
||||||
@ -64,6 +65,9 @@ class LibBuilderFactory(object):
|
|||||||
if isfile(join(path, "module.json")):
|
if isfile(join(path, "module.json")):
|
||||||
return ["mbed"]
|
return ["mbed"]
|
||||||
|
|
||||||
|
include_re = re.compile(
|
||||||
|
r'^#include\s+(<|")(Arduino|mbed)\.h(<|")', flags=re.MULTILINE)
|
||||||
|
|
||||||
# check source files
|
# check source files
|
||||||
for root, _, files in os.walk(path, followlinks=True):
|
for root, _, files in os.walk(path, followlinks=True):
|
||||||
for fname in files:
|
for fname in files:
|
||||||
@ -72,9 +76,9 @@ class LibBuilderFactory(object):
|
|||||||
continue
|
continue
|
||||||
with open(join(root, fname)) as f:
|
with open(join(root, fname)) as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
if "Arduino.h" in content:
|
if "Arduino.h" in content and include_re.search(content):
|
||||||
return ["arduino"]
|
return ["arduino"]
|
||||||
elif "mbed.h" in content:
|
elif "mbed.h" in content and include_re.search(content):
|
||||||
return ["mbed"]
|
return ["mbed"]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user