diff --git a/HISTORY.rst b/HISTORY.rst index 82158846..e5dc3bfb 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -64,9 +64,8 @@ Release History 2.0.1 (2015-05-27) ------------------ -* Handle new environment variables +* Handle new environment variable `PLATFORMIO_BUILD_FLAGS `_ - and `PLATFORMIO_LDF_CYCLIC `_ * Pass to API requests information about Continuous Integration system. This information will be used by PlatformIO-API. * Use ``include`` directories from toolchain when initialising project for IDE diff --git a/docs/envvars.rst b/docs/envvars.rst index d3d0c084..84ed6852 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -84,13 +84,6 @@ PLATFORMIO_SRC_FILTER Allows to set :ref:`projectconf` option :ref:`projectconf_src_filter`. -.. _envvar_PLATFORMIO_LDF_CYCLIC: - -PLATFORMIO_LDF_CYCLIC -~~~~~~~~~~~~~~~~~~~~~ - -Allows to set :ref:`projectconf` option :ref:`projectconf_ldf_cyclic`. - .. _envvar_PLATFORMIO_EXTRA_SCRIPT: PLATFORMIO_EXTRA_SCRIPT diff --git a/docs/projectconf.rst b/docs/projectconf.rst index 8db258c4..2b228bdb 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -382,13 +382,11 @@ Example: [env:ignore_some_libs] ignore_libs = SPI,EngduinoV3_ID123 -.. _projectconf_ldf_cyclic: - -``ldf_cyclic`` +``lib_dfcyclic`` ^^^^^^^^^^^^^^ Control cyclic (recursive) behaviour for ``Library Dependency Finder (LDF)``. -By default, this option is turned OFF (``ldf_cyclic=False``) and means, that +By default, this option is turned OFF (``lib_dfcyclic=False``) and means, that ``LDF`` will find only libraries which are included in source files from the project :ref:`projectconf_pio_src_dir`. @@ -396,15 +394,12 @@ If you want to enable cyclic (recursive, nested) search, please set this option to ``True``. Founded library will be treated like a new source files and ``LDF`` will search dependencies for it. -This option can be set by global environment variable -:ref:`envvar_PLATFORMIO_LDF_CYCLIC`. - Example: .. code-block:: ini [env:libs_with_enabled_ldf_cyclic] - ldf_cyclic = True + lib_dfcyclic = True .. _projectconf_extra_script: diff --git a/platformio/__main__.py b/platformio/__main__.py index a4e44146..2df8de4d 100644 --- a/platformio/__main__.py +++ b/platformio/__main__.py @@ -44,7 +44,7 @@ class PlatformioCLI(click.MultiCommand): # pylint: disable=R0904 "Warning! `platformio %s` command is obsoleted and will be " "removed in the next release! Please use " "`platformio platforms %s` instead." % (name, name), - fg="red" + fg="yellow" ) from platformio.commands import platforms return getattr(platforms, "platforms_" + name) diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 7f9374f6..02a889b9 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -42,7 +42,7 @@ commonvars.AddVariables( ("SRC_FILTER",), ("IGNORE_LIBS",), ("USE_LIBS",), - ("LDF_CYCLIC",), + ("LIB_DFCYCLIC",), # board options ("BOARD",), diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 9c4e2fb9..b2ad1cfd 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -300,8 +300,7 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914 _lib_dir)) state['libs'].add(_lib_dir) - if getenv("PLATFORMIO_LDF_CYCLIC", - env.subst("$LDF_CYCLIC")).lower() == "true": + if env.subst("$LIB_DFCYCLIC").lower() == "true": state = _process_src_dir(state, _lib_dir) return state diff --git a/platformio/commands/run.py b/platformio/commands/run.py index 7f79c506..15418bc8 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -73,6 +73,10 @@ def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914 class EnvironmentProcessor(object): + RENAMED_OPTIONS = { + "LDF_CYCLIC": "LIB_DFCYCLIC" + } + def __init__(self, cmd_ctx, name, options, # pylint: disable=R0913 targets, upload_port, verbose): self.cmd_ctx = cmd_ctx @@ -114,9 +118,21 @@ class EnvironmentProcessor(object): variables.append("UPLOAD_PORT=%s" % self.upload_port) for k, v in self.options.items(): k = k.upper() + + # process obsolete options + if k in self.RENAMED_OPTIONS: + click.secho( + "Warning! `%s` option is obsoleted and will be " + "removed in the next release! Please use " + "`%s` instead." % ( + k.lower(), self.RENAMED_OPTIONS[k].lower()), + fg="yellow" + ) + k = self.RENAMED_OPTIONS[k] + if k == "TARGETS" or (k == "UPLOAD_PORT" and self.upload_port): continue - variables.append("%s=%s" % (k.upper(), v)) + variables.append("%s=%s" % (k, v)) return variables def _get_build_targets(self):