mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 10:37:13 +02:00
Add aliases for LDF compatibility modes
This commit is contained in:
@ -7,6 +7,8 @@ PlatformIO 3.0
|
|||||||
3.5.2 (2018-??-??)
|
3.5.2 (2018-??-??)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
* Added aliases (off, light, strict) for
|
||||||
|
`LDF Compatibility Modes <http://docs.platformio.org/page/librarymanager/ldf.html>`__
|
||||||
* Show device system information (MCU, Frequency, RAM, Flash, Debugging tools)
|
* Show device system information (MCU, Frequency, RAM, Flash, Debugging tools)
|
||||||
in a build log
|
in a build log
|
||||||
* Show all available upload protocols before firmware uploading in a build log
|
* Show all available upload protocols before firmware uploading in a build log
|
||||||
|
2
docs
2
docs
Submodule docs updated: ec9ec10dcd...86ba500aff
@ -86,8 +86,8 @@ class LibBuilderBase(object):
|
|||||||
LDF_MODES = ["off", "chain", "deep", "chain+", "deep+"]
|
LDF_MODES = ["off", "chain", "deep", "chain+", "deep+"]
|
||||||
LDF_MODE_DEFAULT = "chain"
|
LDF_MODE_DEFAULT = "chain"
|
||||||
|
|
||||||
COMPAT_MODES = [0, 1, 2]
|
COMPAT_MODES = ["off", "light", "strict"]
|
||||||
COMPAT_MODE_DEFAULT = 1
|
COMPAT_MODE_DEFAULT = "light"
|
||||||
|
|
||||||
CLASSIC_SCANNER = SCons.Scanner.C.CScanner()
|
CLASSIC_SCANNER = SCons.Scanner.C.CScanner()
|
||||||
ADVANCED_SCANNER = SCons.Scanner.C.CScanner(advanced=True)
|
ADVANCED_SCANNER = SCons.Scanner.C.CScanner(advanced=True)
|
||||||
@ -230,11 +230,14 @@ class LibBuilderBase(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def validate_compat_mode(mode):
|
def validate_compat_mode(mode):
|
||||||
try:
|
if isinstance(mode, basestring):
|
||||||
mode = int(mode)
|
mode = mode.strip().lower()
|
||||||
assert mode in LibBuilderBase.COMPAT_MODES
|
if mode in LibBuilderBase.COMPAT_MODES:
|
||||||
return mode
|
return mode
|
||||||
except (AssertionError, ValueError):
|
try:
|
||||||
|
return LibBuilderBase.COMPAT_MODES[int(mode)]
|
||||||
|
except (IndexError, ValueError):
|
||||||
|
pass
|
||||||
return LibBuilderBase.COMPAT_MODE_DEFAULT
|
return LibBuilderBase.COMPAT_MODE_DEFAULT
|
||||||
|
|
||||||
def is_platforms_compatible(self, platforms):
|
def is_platforms_compatible(self, platforms):
|
||||||
@ -743,13 +746,13 @@ def GetLibBuilders(env): # pylint: disable=too-many-branches
|
|||||||
if verbose:
|
if verbose:
|
||||||
sys.stderr.write("Ignored library %s\n" % lb.path)
|
sys.stderr.write("Ignored library %s\n" % lb.path)
|
||||||
return None
|
return None
|
||||||
if compat_mode > 1 and not lb.is_platforms_compatible(
|
if compat_mode == "strict" and not lb.is_platforms_compatible(
|
||||||
env['PIOPLATFORM']):
|
env['PIOPLATFORM']):
|
||||||
if verbose:
|
if verbose:
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
"Platform incompatible library %s\n" % lb.path)
|
"Platform incompatible library %s\n" % lb.path)
|
||||||
return False
|
return False
|
||||||
if compat_mode > 0 and "PIOFRAMEWORK" in env and \
|
if compat_mode == "light" and "PIOFRAMEWORK" in env and \
|
||||||
not lb.is_frameworks_compatible(env.get("PIOFRAMEWORK", [])):
|
not lb.is_frameworks_compatible(env.get("PIOFRAMEWORK", [])):
|
||||||
if verbose:
|
if verbose:
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
@ -828,20 +831,23 @@ def BuildProjectLibraries(env):
|
|||||||
if lb.depbuilders:
|
if lb.depbuilders:
|
||||||
print_deps_tree(lb, level + 1)
|
print_deps_tree(lb, level + 1)
|
||||||
|
|
||||||
print "Collected %d compatible libraries" % len(lib_builders)
|
|
||||||
print "Scanning dependencies..."
|
|
||||||
|
|
||||||
project = ProjectAsLibBuilder(env, "$PROJECT_DIR")
|
project = ProjectAsLibBuilder(env, "$PROJECT_DIR")
|
||||||
project.env = env
|
project.env = env
|
||||||
|
ldf_mode = LibBuilderBase.lib_ldf_mode.fget(project)
|
||||||
|
|
||||||
|
print "Library Dependency Finder -> http://bit.ly/configure-pio-ldf"
|
||||||
|
print "Modes: Finder/%s Compatibility/%s" % (ldf_mode,
|
||||||
|
project.lib_compat_mode)
|
||||||
|
print "Collected %d compatible libraries" % len(lib_builders)
|
||||||
|
|
||||||
|
print "Scanning dependencies..."
|
||||||
project.search_deps_recursive()
|
project.search_deps_recursive()
|
||||||
|
|
||||||
if (LibBuilderBase.validate_ldf_mode(
|
if ldf_mode.startswith("chain") and project.depbuilders:
|
||||||
env.get("LIB_LDF_MODE", LibBuilderBase.LDF_MODE_DEFAULT))
|
|
||||||
.startswith("chain") and project.depbuilders):
|
|
||||||
correct_found_libs()
|
correct_found_libs()
|
||||||
|
|
||||||
if project.depbuilders:
|
if project.depbuilders:
|
||||||
print "Library Dependency Graph ( http://bit.ly/configure-pio-ldf )"
|
print "Dependency Graph"
|
||||||
print_deps_tree(project)
|
print_deps_tree(project)
|
||||||
else:
|
else:
|
||||||
print "No dependencies"
|
print "No dependencies"
|
||||||
|
Reference in New Issue
Block a user