Skip to content

Commit

Permalink
Install a dev-platform with ALL declared packages using a new ``--wit…
Browse files Browse the repository at this point in the history
…h-all-packages`` option // Resolve #3345
  • Loading branch information
ivankravets committed Jan 24, 2020
1 parent a62bc38 commit 2033477
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ PlatformIO Core 4.0
- Added support for `PVS-Studio <https://docs.platformio.org/page/plus/check-tools/pvs-studio.html>`__ static code analyzer

* Control debug flags and optimization level with a new `debug_build_flags <https://docs.platformio.org/page/projectconf/section_env_debug.html#debug-build-flags>`__ option
* Install a dev-platform with ALL declared packages using a new ``--with-all-packages`` option for `pio platform install <https://docs.platformio.org/page/userguide/platforms/cmd_install.html>`__ command (`issue #3345 <https://github.com/platformio/platformio-core/issues/3345>`_)
* Added support for "pythonPackages" in `platform.json <https://docs.platformio.org/page/platforms/creating_platform.html#manifest-file-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 <https://github.com/platformio/platformio-core/issues/2591>`_)
* Updated SCons tool to 3.1.2
Expand Down
2 changes: 1 addition & 1 deletion docs
11 changes: 9 additions & 2 deletions platformio/commands/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions platformio/managers/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def install(
with_packages=None,
without_packages=None,
skip_default_package=False,
with_all_packages=False,
after_update=False,
silent=False,
force=False,
Expand All @@ -84,6 +85,9 @@ def install(
)
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:
Expand Down

0 comments on commit 2033477

Please sign in to comment.