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
@@ -168,7 +168,7 @@ env.SConsignFile(
|
||||
env.SConscript(env.GetExtraScripts("pre"), exports="env")
|
||||
|
||||
if env.IsCleanTarget():
|
||||
env.CleanProject("cleanall" in COMMAND_LINE_TARGETS)
|
||||
env.CleanProject(fullclean=int(ARGUMENTS.get("FULLCLEAN", 0)))
|
||||
env.Exit(0)
|
||||
|
||||
env.SConscript("$BUILD_SCRIPT")
|
||||
|
||||
@@ -16,7 +16,6 @@ import os
|
||||
|
||||
from SCons.Action import Action # pylint: disable=import-error
|
||||
from SCons.Script import ARGUMENTS # pylint: disable=import-error
|
||||
from SCons.Script import COMMAND_LINE_TARGETS # pylint: disable=import-error
|
||||
from SCons.Script import AlwaysBuild # pylint: disable=import-error
|
||||
|
||||
from platformio import compat, fs
|
||||
@@ -29,10 +28,10 @@ def VerboseAction(_, act, actstr):
|
||||
|
||||
|
||||
def IsCleanTarget(env):
|
||||
return env.GetOption("clean") or ("cleanall" in COMMAND_LINE_TARGETS)
|
||||
return env.GetOption("clean")
|
||||
|
||||
|
||||
def CleanProject(env, clean_all=False):
|
||||
def CleanProject(env, fullclean=False):
|
||||
def _relpath(path):
|
||||
if compat.IS_WINDOWS:
|
||||
prefix = os.getcwd()[:2].lower()
|
||||
@@ -56,7 +55,7 @@ def CleanProject(env, clean_all=False):
|
||||
else:
|
||||
print("Build environment is clean")
|
||||
|
||||
if clean_all and os.path.isdir(libdeps_dir):
|
||||
if fullclean and os.path.isdir(libdeps_dir):
|
||||
_clean_dir(libdeps_dir)
|
||||
|
||||
print("Done cleaning")
|
||||
|
||||
Reference in new issue
Block a user