forked from platformio/platformio-core
Better handling "clean" & "monitor" targets
This commit is contained in:
1 parent
53cd43b676
commit
c8eea40dd0
6 files changed
+123
-105
No files matched your search
@@ -25,6 +25,7 @@ from platformio import app, fs, proc, telemetry
|
||||
from platformio.compat import hashlib_encode_data
|
||||
from platformio.package.manager.core import get_core_package_dir
|
||||
from platformio.platform.exception import BuildScriptNotFound
|
||||
from platformio.run.helpers import KNOWN_CLEAN_TARGETS, KNOWN_FULLCLEAN_TARGETS
|
||||
|
||||
|
||||
class PlatformRunMixin:
|
||||
@@ -56,9 +57,6 @@ class PlatformRunMixin:
|
||||
self.silent = silent
|
||||
self.verbose = verbose or app.get_setting("force_verbose")
|
||||
|
||||
if "clean" in targets:
|
||||
targets = ["-c", "."]
|
||||
|
||||
variables["platform_manifest"] = self.manifest_path
|
||||
|
||||
if "build_script" not in variables:
|
||||
@@ -92,10 +90,18 @@ class PlatformRunMixin:
|
||||
"--sconstruct",
|
||||
os.path.join(fs.get_source_dir(), "builder", "main.py"),
|
||||
]
|
||||
args.append("PIOVERBOSE=%d" % (1 if self.verbose else 0))
|
||||
args.append("PIOVERBOSE=%d" % int(self.verbose))
|
||||
# pylint: disable=protected-access
|
||||
args.append("ISATTY=%d" % (1 if click._compat.isatty(sys.stdout) else 0))
|
||||
args += targets
|
||||
args.append("ISATTY=%d" % int(click._compat.isatty(sys.stdout)))
|
||||
|
||||
if set(KNOWN_CLEAN_TARGETS + KNOWN_FULLCLEAN_TARGETS) & set(targets):
|
||||
args.append("--clean")
|
||||
args.append(
|
||||
"FULLCLEAN=%d"
|
||||
% (1 if set(KNOWN_FULLCLEAN_TARGETS) & set(targets) else 0)
|
||||
)
|
||||
elif targets:
|
||||
args.extend(targets)
|
||||
|
||||
# encode and append variables
|
||||
for key, value in variables.items():
|
||||
|
||||
Reference in new issue
Block a user