mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Summary about processed environments // Resolve #777
This commit is contained in:
@ -9,6 +9,8 @@ PlatformIO 3.0
|
|||||||
|
|
||||||
* New! Dynamic variables/templates for `Project Configuration File "platformio.ini" <http://docs.platformio.org/en/stable/projectconf.html>`__
|
* New! Dynamic variables/templates for `Project Configuration File "platformio.ini" <http://docs.platformio.org/en/stable/projectconf.html>`__
|
||||||
(`issue #705 <https://github.com/platformio/platformio/issues/705>`_)
|
(`issue #705 <https://github.com/platformio/platformio/issues/705>`_)
|
||||||
|
* Summary about processed environments
|
||||||
|
(`issue #777 <https://github.com/platformio/platformio/issues/777>`_)
|
||||||
* Implemented LocalCache system for API and improved a work in off-line mode
|
* Implemented LocalCache system for API and improved a work in off-line mode
|
||||||
* Improved Project Generator when custom ``--project-option`` is passed to
|
* Improved Project Generator when custom ``--project-option`` is passed to
|
||||||
`platformio init <http://docs.platformio.org/en/stable/userguide/cmd_init.html>`__
|
`platformio init <http://docs.platformio.org/en/stable/userguide/cmd_init.html>`__
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
VERSION = (3, 1, "0a4")
|
VERSION = (3, 1, "0a5")
|
||||||
__version__ = ".".join([str(s) for s in VERSION])
|
__version__ = ".".join([str(s) for s in VERSION])
|
||||||
|
|
||||||
__title__ = "platformio"
|
__title__ = "platformio"
|
||||||
|
@ -80,7 +80,8 @@ def cli(ctx, environment, target, upload_port, project_dir, silent, verbose,
|
|||||||
for e in config.get("platformio", "env_default").split(",")
|
for e in config.get("platformio", "env_default").split(",")
|
||||||
]
|
]
|
||||||
|
|
||||||
results = []
|
results = {}
|
||||||
|
start_time = time()
|
||||||
for section in config.sections():
|
for section in config.sections():
|
||||||
if not section.startswith("env:"):
|
if not section.startswith("env:"):
|
||||||
continue
|
continue
|
||||||
@ -90,7 +91,7 @@ def cli(ctx, environment, target, upload_port, project_dir, silent, verbose,
|
|||||||
not environment and env_default and
|
not environment and env_default and
|
||||||
envname not in env_default])
|
envname not in env_default])
|
||||||
if skipenv:
|
if skipenv:
|
||||||
# echo("Skipped %s environment" % style(envname, fg="yellow"))
|
results[envname] = None
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if results:
|
if results:
|
||||||
@ -104,9 +105,35 @@ def cli(ctx, environment, target, upload_port, project_dir, silent, verbose,
|
|||||||
|
|
||||||
ep = EnvironmentProcessor(ctx, envname, options, target,
|
ep = EnvironmentProcessor(ctx, envname, options, target,
|
||||||
upload_port, silent, verbose)
|
upload_port, silent, verbose)
|
||||||
results.append(ep.process())
|
results[envname] = ep.process()
|
||||||
|
|
||||||
if not all(results):
|
errored = False
|
||||||
|
if len(results) > 1:
|
||||||
|
click.echo()
|
||||||
|
print_header("[%s]" % click.style("SUMMARY"))
|
||||||
|
|
||||||
|
for envname, status in results.items():
|
||||||
|
errored = False
|
||||||
|
status_str = click.style("SUCCESS", fg="green")
|
||||||
|
if status is False:
|
||||||
|
errored = True
|
||||||
|
status_str = click.style("ERROR", fg="red")
|
||||||
|
elif status is None:
|
||||||
|
status_str = click.style("SKIP", fg="yellow")
|
||||||
|
|
||||||
|
click.echo(
|
||||||
|
"Environment %s:\t[%s]" % (click.style(
|
||||||
|
envname, fg="cyan"), status_str),
|
||||||
|
err=status is False)
|
||||||
|
|
||||||
|
print_header(
|
||||||
|
"[%s] Took %.2f seconds" % ((click.style(
|
||||||
|
"SUCCESS", fg="green",
|
||||||
|
bold=True) if not errored else click.style(
|
||||||
|
"ERROR", fg="red", bold=True)), time() - start_time),
|
||||||
|
is_error=errored)
|
||||||
|
|
||||||
|
if any([r is False for r in results.values()]):
|
||||||
raise exception.ReturnErrorCode()
|
raise exception.ReturnErrorCode()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user