diff --git a/HISTORY.rst b/HISTORY.rst index 3b290650..637fd75e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -19,6 +19,7 @@ PlatformIO Core 4.0 - Added support for `PVS-Studio `__ static code analyzer * Control debug flags and optimization level with a new `debug_build_flags `__ option +* Install a dev-platform with ALL declared packages using a new ``--with-all-packages`` option for `pio platform install `__ command (`issue #3345 `_) * Added support for "pythonPackages" in `platform.json `__ manifest (PlatformIO Package Manager will install dependent Python packages from PyPi registry automatically when dev-platform is installed) * Handle project configuration (monitor, test, and upload options) for PIO Remote commands (`issue #2591 `_) * Updated SCons tool to 3.1.2 diff --git a/docs b/docs index cfc5eed0..7b3bc149 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit cfc5eed060900a8b5510c23e269b773019e3882f +Subproject commit 7b3bc1494aed26fd2e33940bc44dd81b9231a115 diff --git a/platformio/commands/platform.py b/platformio/commands/platform.py index c094b560..d4ff4930 100644 --- a/platformio/commands/platform.py +++ b/platformio/commands/platform.py @@ -299,14 +299,20 @@ def platform_show(platform, json_output): # pylint: disable=too-many-branches @click.option("--with-package", multiple=True) @click.option("--without-package", multiple=True) @click.option("--skip-default-package", is_flag=True) +@click.option("--with-all-packages", is_flag=True) @click.option( "-f", "--force", is_flag=True, help="Reinstall/redownload dev/platform and its packages if exist", ) -def platform_install( - platforms, with_package, without_package, skip_default_package, force +def platform_install( # pylint: disable=too-many-arguments + platforms, + with_package, + without_package, + skip_default_package, + with_all_packages, + force, ): pm = PlatformManager() for platform in platforms: @@ -315,6 +321,7 @@ def platform_install( with_packages=with_package, without_packages=without_package, skip_default_package=skip_default_package, + with_all_packages=with_all_packages, force=force, ): click.secho( diff --git a/platformio/managers/platform.py b/platformio/managers/platform.py index 983cab50..8f23f1bd 100644 --- a/platformio/managers/platform.py +++ b/platformio/managers/platform.py @@ -74,6 +74,7 @@ class PlatformManager(BasePkgManager): with_packages=None, without_packages=None, skip_default_package=False, + with_all_packages=False, after_update=False, silent=False, force=False, @@ -84,6 +85,9 @@ class PlatformManager(BasePkgManager): ) p = PlatformFactory.newPlatform(platform_dir) + if with_all_packages: + with_packages = list(p.packages.keys()) + # don't cleanup packages or install them after update # we check packages for updates in def update() if after_update: