forked from platformio/platformio-core
Use common IDE data loading for IDE and DEBUG
This commit is contained in:
@@ -20,8 +20,8 @@ import click
|
||||
|
||||
from platformio import exception, util
|
||||
from platformio.commands.device import device_monitor as cmd_device_monitor
|
||||
from platformio.commands.run.helpers import (_clean_build_dir,
|
||||
_handle_legacy_libdeps,
|
||||
from platformio.commands.run.helpers import (clean_build_dir,
|
||||
handle_legacy_libdeps,
|
||||
print_summary)
|
||||
from platformio.commands.run.processor import EnvironmentProcessor
|
||||
from platformio.project.config import ProjectConfig
|
||||
@@ -64,7 +64,7 @@ def cli(ctx, environment, target, upload_port, project_dir, project_conf,
|
||||
# clean obsolete build dir
|
||||
if not disable_auto_clean:
|
||||
try:
|
||||
_clean_build_dir(get_project_build_dir())
|
||||
clean_build_dir(get_project_build_dir())
|
||||
except: # pylint: disable=bare-except
|
||||
click.secho(
|
||||
"Can not remove temporary directory `%s`. Please remove "
|
||||
@@ -76,7 +76,7 @@ def cli(ctx, environment, target, upload_port, project_dir, project_conf,
|
||||
project_conf or join(project_dir, "platformio.ini"))
|
||||
config.validate(environment)
|
||||
|
||||
_handle_legacy_libdeps(project_dir, config)
|
||||
handle_legacy_libdeps(project_dir, config)
|
||||
|
||||
results = []
|
||||
start_time = time()
|
||||
|
||||
@@ -27,7 +27,7 @@ from platformio.project.helpers import (calculate_project_hash,
|
||||
get_project_libdeps_dir)
|
||||
|
||||
|
||||
def _handle_legacy_libdeps(project_dir, config):
|
||||
def handle_legacy_libdeps(project_dir, config):
|
||||
legacy_libdeps_dir = join(project_dir, ".piolibdeps")
|
||||
if (not isdir(legacy_libdeps_dir)
|
||||
or legacy_libdeps_dir == get_project_libdeps_dir()):
|
||||
@@ -46,7 +46,7 @@ def _handle_legacy_libdeps(project_dir, config):
|
||||
fg="yellow")
|
||||
|
||||
|
||||
def _autoinstall_libdeps(ctx, envname, libraries, verbose=False):
|
||||
def autoinstall_libdeps(ctx, envname, libraries, verbose=False):
|
||||
if not libraries:
|
||||
return
|
||||
libdeps_dir = join(get_project_libdeps_dir(), envname)
|
||||
@@ -62,7 +62,7 @@ def _autoinstall_libdeps(ctx, envname, libraries, verbose=False):
|
||||
click.secho(str(e), fg="yellow")
|
||||
|
||||
|
||||
def _clean_build_dir(build_dir):
|
||||
def clean_build_dir(build_dir):
|
||||
# remove legacy ".pioenvs" folder
|
||||
legacy_build_dir = join(get_project_dir(), ".pioenvs")
|
||||
if isdir(legacy_build_dir) and legacy_build_dir != build_dir:
|
||||
|
||||
@@ -19,7 +19,7 @@ import click
|
||||
from platformio import exception, telemetry
|
||||
from platformio.commands.platform import \
|
||||
platform_install as cmd_platform_install
|
||||
from platformio.commands.run.helpers import _autoinstall_libdeps, print_header
|
||||
from platformio.commands.run.helpers import autoinstall_libdeps, print_header
|
||||
from platformio.commands.test.processor import (CTX_META_TEST_IS_RUNNING,
|
||||
CTX_META_TEST_RUNNING_NAME)
|
||||
from platformio.managers.platform import PlatformFactory
|
||||
@@ -104,7 +104,7 @@ class EnvironmentProcessor(object):
|
||||
if "monitor" in build_targets:
|
||||
build_targets.remove("monitor")
|
||||
if "nobuild" not in build_targets and "lib_deps" in self.options:
|
||||
_autoinstall_libdeps(
|
||||
autoinstall_libdeps(
|
||||
self.cmd_ctx, self.name,
|
||||
self.config.get("env:" + self.name, "lib_deps"), self.verbose)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user