Rename "use_libs" env option to "lib_use"

This commit is contained in:
Ivan Kravets
2015-06-28 19:44:35 +03:00
parent 776a2027fb
commit ebdbf79868
5 changed files with 17 additions and 16 deletions

View File

@ -109,7 +109,7 @@ Release History
option in ``platformio.ini``
(`issue #134 <https://github.com/platformio/platformio/issues/134>`_)
* 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``
(`issue #148 <https://github.com/platformio/platformio/issues/148>`_)
* Add more boards to PlatformIO project with

View File

@ -352,23 +352,23 @@ You can obtain library IDs using :ref:`cmd_lib_search` command.
Example:
.. code-block:: ini
.. code-block:: ini
[env:depends_on_some_libs]
install_libs = 1,13,19
``use_libs``
^^^^^^^^^^^^
``lib_use``
^^^^^^^^^^^
Specify libraries which should be used by ``Library Dependency Finder (LDF)`` with
the highest priority.
Example:
.. code-block:: ini
.. code-block:: ini
[env:libs_with_highest_priority]
use_libs = OneWire_ID1
lib_use = OneWire_ID1,SPI
``lib_ignore``
^^^^^^^^^^^^^^
@ -377,7 +377,7 @@ Specify libraries which should be ignored by ``Library Dependency Finder (LDF)``
Example:
.. code-block:: ini
.. code-block:: ini
[env:ignore_some_libs]
lib_ignore = SPI,EngduinoV3_ID123
@ -396,7 +396,7 @@ to ``True``. Founded library will be treated like a new source files and
Example:
.. code-block:: ini
.. code-block:: ini
[env:libs_with_enabled_ldf_cyclic]
lib_dfcyclic = True

View File

@ -40,9 +40,9 @@ commonvars.AddVariables(
("BUILD_FLAGS",),
("SRCBUILD_FLAGS",),
("SRC_FILTER",),
("LIB_IGNORE",),
("USE_LIBS",),
("LIB_DFCYCLIC",),
("LIB_IGNORE",),
("LIB_USE",),
# board options
("BOARD",),
@ -118,8 +118,10 @@ if "BOARD" in env:
env.get("BOARD_OPTIONS", {}).get("platform")))
if "LIB_IGNORE" in env:
env['LIB_IGNORE'] = [l.strip() for l in env['LIB_IGNORE'].split(",")]
for opt in ("LIB_IGNORE", "LIB_USE"):
if opt not in env:
continue
env[opt] = [l.strip() for l in env[opt].split(",") if l.strip()]
env.PrependENVPath(
"PATH",

View File

@ -186,8 +186,6 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
INCLUDES_RE = re.compile(
r"^\s*#include\s+(\<|\")([^\>\"\']+)(?:\>|\")", re.M)
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
@ -228,7 +226,7 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
if not isdir(lsd_dir):
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)):
continue

View File

@ -75,7 +75,8 @@ class EnvironmentProcessor(object):
RENAMED_OPTIONS = {
"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