diff --git a/HISTORY.rst b/HISTORY.rst index b9a19c34..763eb9d3 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -20,7 +20,7 @@ PlatformIO 3.0 + Check library compatibility with project environment before building (`issue #415 `_) + Control Library Dependency Finder for compatibility using - `lib_compat_level `__ + `lib_compat_mode `__ option + Custom library storages/directories with `lib_extra_dirs `__ option diff --git a/docs/faq.rst b/docs/faq.rst index 72b13163..e8f650d5 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -57,12 +57,12 @@ order: 2. :ref:`projectconf_pio_lib_dir` 3. :ref:`projectconf_pio_home_dir`/lib -Library Dependency Finder has a few key factors from :ref:`projectconf`: +Library Dependency Finder has a few controls from :ref:`projectconf`: * :ref:`projectconf_lib_ignore` * :ref:`projectconf_lib_deep_search` * :ref:`projectconf_lib_extra_dirs` -* :ref:`projectconf_lib_compat_level` +* :ref:`projectconf_lib_compat_mode` Command completion in Terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/projectconf.rst b/docs/projectconf.rst index 6f5ae26f..3f4a9005 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -729,25 +729,25 @@ Example: [env:custom_lib_dirs] lib_extra_dirs = /path/to/private/dir1,/path/to/private/dir2 -.. _projectconf_lib_compat_level: +.. _projectconf_lib_compat_mode: -``lib_compat_level`` -^^^^^^^^^^^^^^^^^^^^ +``lib_compat_mode`` +^^^^^^^^^^^^^^^^^^^ Please make sure to read :ref:`faq_ldf` guides first. -Library compatibility level that allows to control Library Dependency Finder +Library compatibility mode that allows to control Library Dependency Finder strictness. If library contains manifest file (:ref:`library_config`, ``library.properties``, ``module.json``), then LDF check compatibility of this -library with real build environment. Available compatibility levels: +library with real build environment. Available compatibility modes: -* ``0`` - don't check for compatibility (disable) +* ``0`` - don't check for compatibility * ``1`` - check for the compatibility with :ref:`projectconf_env_framework` from build environment * ``2`` - check for the compatibility with :ref:`projectconf_env_framework` and :ref:`projectconf_env_platform` from build environment. -By default, this value is set to ``lib_compat_level = 1`` and means that LDF +By default, this value is set to ``lib_compat_mode = 1`` and means that LDF will check only for framework compatibility. ----------- diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 1fc1d079..40184898 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -45,7 +45,7 @@ commonvars.AddVariables( # library options ("LIB_DEEP_SEARCH",), - ("LIB_COMPAT_LEVEL",), + ("LIB_COMPAT_MODE",), ("LIB_IGNORE",), ("LIB_FORCE",), ("LIB_EXTRA_DIRS",), diff --git a/platformio/builder/tools/piolib.py b/platformio/builder/tools/piolib.py index ce1a110a..7e94f784 100644 --- a/platformio/builder/tools/piolib.py +++ b/platformio/builder/tools/piolib.py @@ -463,7 +463,7 @@ def GetLibBuilders(env): env_frameworks = [ f.lower().strip() for f in env.get("PIOFRAMEWORK", "").split(",") ] - compat_level = int(env.get("LIB_COMPAT_LEVEL", 1)) + compat_mode = int(env.get("LIB_COMPAT_MODE", 1)) for libs_dir in env['LIBSOURCE_DIRS']: libs_dir = env.subst(libs_dir) @@ -477,14 +477,14 @@ def GetLibBuilders(env): if not env.GetOption("silent"): sys.stderr.write("Ignored library %s\n" % lb.path) continue - if compat_level > 1 and not lb.is_platform_compatible(env[ + if compat_mode > 1 and not lb.is_platform_compatible(env[ 'PIOPLATFORM']): if not env.GetOption("silent"): sys.stderr.write("Platform incompatible library %s\n" % lb.path) continue - if compat_level > 0 and not any([lb.is_framework_compatible(f) - for f in env_frameworks]): + if compat_mode > 0 and not any([lb.is_framework_compatible(f) + for f in env_frameworks]): if not env.GetOption("silent"): sys.stderr.write("Framework incompatible library %s\n" % lb.path)