forked from platformio/platformio-core
Revert "Revert back "Look firstly in built-in library storages""
This reverts commit 4ae302762a.
This commit is contained in:
@@ -18,10 +18,7 @@ from time import time
|
||||
|
||||
import click
|
||||
|
||||
from platformio import exception, util
|
||||
from platformio.commands.lib import (CTX_META_STORAGE_DIRS_KEY,
|
||||
CTX_META_STORAGE_LIBDEPS_KEY)
|
||||
from platformio.commands.lib import lib_install as cmd_lib_install
|
||||
from platformio import util
|
||||
from platformio.project.helpers import (calculate_project_hash,
|
||||
get_project_dir,
|
||||
get_project_libdeps_dir)
|
||||
@@ -46,22 +43,6 @@ def handle_legacy_libdeps(project_dir, config):
|
||||
fg="yellow")
|
||||
|
||||
|
||||
def autoinstall_libdeps(ctx, envname, libraries, verbose=False):
|
||||
if not libraries:
|
||||
return
|
||||
libdeps_dir = join(get_project_libdeps_dir(), envname)
|
||||
ctx.meta.update({
|
||||
CTX_META_STORAGE_DIRS_KEY: [libdeps_dir],
|
||||
CTX_META_STORAGE_LIBDEPS_KEY: {
|
||||
libdeps_dir: libraries
|
||||
}
|
||||
})
|
||||
try:
|
||||
ctx.invoke(cmd_lib_install, silent=not verbose)
|
||||
except exception.InternetIsOffline as e:
|
||||
click.secho(str(e), fg="yellow")
|
||||
|
||||
|
||||
def clean_build_dir(build_dir):
|
||||
# remove legacy ".pioenvs" folder
|
||||
legacy_build_dir = join(get_project_dir(), ".pioenvs")
|
||||
|
||||
@@ -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 print_header
|
||||
from platformio.commands.test.processor import (CTX_META_TEST_IS_RUNNING,
|
||||
CTX_META_TEST_RUNNING_NAME)
|
||||
from platformio.managers.platform import PlatformFactory
|
||||
@@ -103,10 +103,6 @@ class EnvironmentProcessor(object):
|
||||
# skip monitor target, we call it above
|
||||
if "monitor" in build_targets:
|
||||
build_targets.remove("monitor")
|
||||
if "nobuild" not in build_targets and "lib_deps" in self.options:
|
||||
autoinstall_libdeps(
|
||||
self.cmd_ctx, self.name,
|
||||
self.config.get("env:" + self.name, "lib_deps"), self.verbose)
|
||||
|
||||
try:
|
||||
p = PlatformFactory.newPlatform(self.options['platform'])
|
||||
|
||||
Reference in New Issue
Block a user