mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 02:27:13 +02:00
Rename "use_libs" env option to "lib_use"
This commit is contained in:
@ -109,7 +109,7 @@ Release History
|
|||||||
option in ``platformio.ini``
|
option in ``platformio.ini``
|
||||||
(`issue #134 <https://github.com/platformio/platformio/issues/134>`_)
|
(`issue #134 <https://github.com/platformio/platformio/issues/134>`_)
|
||||||
* Specify libraries which are compatible with build environment using
|
* Specify libraries which are compatible with build environment using
|
||||||
`use_libs <http://docs.platformio.org/en/latest/projectconf.html#use-libs>`_
|
`lib_use <http://docs.platformio.org/en/latest/projectconf.html#lib-use>`_
|
||||||
option in ``platformio.ini``
|
option in ``platformio.ini``
|
||||||
(`issue #148 <https://github.com/platformio/platformio/issues/148>`_)
|
(`issue #148 <https://github.com/platformio/platformio/issues/148>`_)
|
||||||
* Add more boards to PlatformIO project with
|
* Add more boards to PlatformIO project with
|
||||||
|
@ -357,8 +357,8 @@ Example:
|
|||||||
[env:depends_on_some_libs]
|
[env:depends_on_some_libs]
|
||||||
install_libs = 1,13,19
|
install_libs = 1,13,19
|
||||||
|
|
||||||
``use_libs``
|
``lib_use``
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
|
|
||||||
Specify libraries which should be used by ``Library Dependency Finder (LDF)`` with
|
Specify libraries which should be used by ``Library Dependency Finder (LDF)`` with
|
||||||
the highest priority.
|
the highest priority.
|
||||||
@ -368,7 +368,7 @@ Example:
|
|||||||
.. code-block:: ini
|
.. code-block:: ini
|
||||||
|
|
||||||
[env:libs_with_highest_priority]
|
[env:libs_with_highest_priority]
|
||||||
use_libs = OneWire_ID1
|
lib_use = OneWire_ID1,SPI
|
||||||
|
|
||||||
``lib_ignore``
|
``lib_ignore``
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
|
@ -40,9 +40,9 @@ commonvars.AddVariables(
|
|||||||
("BUILD_FLAGS",),
|
("BUILD_FLAGS",),
|
||||||
("SRCBUILD_FLAGS",),
|
("SRCBUILD_FLAGS",),
|
||||||
("SRC_FILTER",),
|
("SRC_FILTER",),
|
||||||
("LIB_IGNORE",),
|
|
||||||
("USE_LIBS",),
|
|
||||||
("LIB_DFCYCLIC",),
|
("LIB_DFCYCLIC",),
|
||||||
|
("LIB_IGNORE",),
|
||||||
|
("LIB_USE",),
|
||||||
|
|
||||||
# board options
|
# board options
|
||||||
("BOARD",),
|
("BOARD",),
|
||||||
@ -118,8 +118,10 @@ if "BOARD" in env:
|
|||||||
env.get("BOARD_OPTIONS", {}).get("platform")))
|
env.get("BOARD_OPTIONS", {}).get("platform")))
|
||||||
|
|
||||||
|
|
||||||
if "LIB_IGNORE" in env:
|
for opt in ("LIB_IGNORE", "LIB_USE"):
|
||||||
env['LIB_IGNORE'] = [l.strip() for l in env['LIB_IGNORE'].split(",")]
|
if opt not in env:
|
||||||
|
continue
|
||||||
|
env[opt] = [l.strip() for l in env[opt].split(",") if l.strip()]
|
||||||
|
|
||||||
env.PrependENVPath(
|
env.PrependENVPath(
|
||||||
"PATH",
|
"PATH",
|
||||||
|
@ -186,8 +186,6 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
|
|||||||
INCLUDES_RE = re.compile(
|
INCLUDES_RE = re.compile(
|
||||||
r"^\s*#include\s+(\<|\")([^\>\"\']+)(?:\>|\")", re.M)
|
r"^\s*#include\s+(\<|\")([^\>\"\']+)(?:\>|\")", re.M)
|
||||||
LIBSOURCE_DIRS = [env.subst(d) for d in env.get("LIBSOURCE_DIRS", [])]
|
LIBSOURCE_DIRS = [env.subst(d) for d in env.get("LIBSOURCE_DIRS", [])]
|
||||||
USE_LIBS = [l.strip() for l in env.get("USE_LIBS", "").split(",")
|
|
||||||
if l.strip()]
|
|
||||||
|
|
||||||
# start internal prototypes
|
# start internal prototypes
|
||||||
|
|
||||||
@ -228,7 +226,7 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
|
|||||||
if not isdir(lsd_dir):
|
if not isdir(lsd_dir):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for ld in USE_LIBS + sorted(listdir(lsd_dir)):
|
for ld in env.get("LIB_USE", []) + sorted(listdir(lsd_dir)):
|
||||||
if not isdir(join(lsd_dir, ld)):
|
if not isdir(join(lsd_dir, ld)):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -75,7 +75,8 @@ class EnvironmentProcessor(object):
|
|||||||
|
|
||||||
RENAMED_OPTIONS = {
|
RENAMED_OPTIONS = {
|
||||||
"LDF_CYCLIC": "LIB_DFCYCLIC",
|
"LDF_CYCLIC": "LIB_DFCYCLIC",
|
||||||
"IGNORE_LIBS": "LIB_IGNORE"
|
"IGNORE_LIBS": "LIB_IGNORE",
|
||||||
|
"USE_LIBS": "LIB_USE"
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, cmd_ctx, name, options, # pylint: disable=R0913
|
def __init__(self, cmd_ctx, name, options, # pylint: disable=R0913
|
||||||
|
Reference in New Issue
Block a user