From 5a91d0bf1b3f4045a17505e02f5eb6ac274f56f7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 21 Jul 2015 14:53:38 +0300 Subject: [PATCH] Disable project auto-clean while building/uploading firmware // Resolve #255 --- HISTORY.rst | 7 +++++++ docs/userguide/cmd_run.rst | 6 ++++++ platformio/__init__.py | 2 +- platformio/commands/run.py | 6 ++++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 9fe0c734..81e84067 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,13 @@ Release History =============== +2.2.2 (2015-??-??) +------------------ + +* Disable project auto-clean while building/uploading firmware using + `platformio run --disable-auto-clean `_ option + (`issue #255 `_) + 2.2.1 (2015-07-17) ------------------ diff --git a/docs/userguide/cmd_run.rst b/docs/userguide/cmd_run.rst index 468f22cd..62cd265c 100644 --- a/docs/userguide/cmd_run.rst +++ b/docs/userguide/cmd_run.rst @@ -62,6 +62,12 @@ There 3 levels of verbosity: By default, verbosity level is set to 3 (maximum information). +.. option:: + --disable-auto-clean + +Disable auto-clean of :ref:`projectconf_pio_envs_dir` when :ref:`projectconf` +or :ref:`projectconf_pio_src_dir` (project structure) have been modified. + Examples -------- diff --git a/platformio/__init__.py b/platformio/__init__.py index bf88694a..41fd61bb 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 2, 1) +VERSION = (2, 2, "2.dev0") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/commands/run.py b/platformio/commands/run.py index 4b8ec5b2..14ab8271 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -26,9 +26,10 @@ from platformio.platforms.base import PlatformFactory type=click.Path(exists=True, file_okay=False, dir_okay=True, writable=True, resolve_path=True)) @click.option("--verbose", "-v", count=True, default=3) +@click.option("--disable-auto-clean", is_flag=True) @click.pass_context def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914 - project_dir, verbose): + project_dir, verbose, disable_auto_clean): with util.cd(project_dir): config = util.get_project_config() @@ -40,7 +41,8 @@ def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914 raise exception.UnknownEnvNames(", ".join(unknown)) # clean obsolete .pioenvs dir - _clean_pioenvs_dir() + if not disable_auto_clean: + _clean_pioenvs_dir() results = [] for section in config.sections():