Do not install tool-unity for even non-test proejct

This commit is contained in:
Ivan Kravets
2021-01-20 14:27:03 +02:00
parent 733ca5174b
commit 9b93fcd947
2 changed files with 4 additions and 2 deletions

View File

@ -59,7 +59,7 @@ def _dump_includes(env):
includes["toolchain"].extend([os.path.realpath(inc) for inc in glob(g)])
includes["unity"] = []
unity_dir = get_core_package_dir("tool-unity")
unity_dir = get_core_package_dir("tool-unity", auto_install=False)
if unity_dir:
includes["unity"].append(unity_dir)

View File

@ -27,7 +27,7 @@ from platformio.package.meta import PackageItem, PackageSpec
from platformio.proc import get_pythonexe_path
def get_core_package_dir(name):
def get_core_package_dir(name, auto_install=True):
if name not in __core_packages__:
raise exception.PlatformioException("Please upgrade PlatformIO Core")
pm = ToolPackageManager()
@ -37,6 +37,8 @@ def get_core_package_dir(name):
pkg = pm.get_package(spec)
if pkg:
return pkg.path
if not auto_install:
return None
assert pm.install(spec)
_remove_unnecessary_packages()
return pm.get_package(spec).path