forked from platformio/platformio-core
Do not build project when only "monitor" target is passed
This commit is contained in:
@ -17,10 +17,11 @@ PlatformIO Core 6
|
||||
6.1.7 (2023-??-??)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Show detailed library dependency tree only in the `verbose mode <https://docs.platformio.org/en/latest/core/userguide/cmd_run.html#cmdoption-pio-run-v>`__ (`issue #4517 <https://github.com/platformio/platformio-core/issues/4517>`_)
|
||||
* Prevented shell injection when converting INO file to CPP (`issue #4532 <https://github.com/platformio/platformio-core/issues/4532>`_)
|
||||
* Restored project generator for `NetBeans IDE <https://docs.platformio.org/en/latest/integration/ide/netbeans.html>`__
|
||||
* Improved source file filtering functionality for `Static Code Analysis <https://docs.platformio.org/en/latest/advanced/static-code-analysis/index.html>`__ feature
|
||||
* Improved source file filtering functionality for the `Static Code Analysis <https://docs.platformio.org/en/latest/advanced/static-code-analysis/index.html>`__ feature, making it easier to analyze only the code you need to
|
||||
* Added the ability to show a detailed library dependency tree only in `verbose mode <https://docs.platformio.org/en/latest/core/userguide/cmd_run.html#cmdoption-pio-run-v>`__, which can help you understand the relationship between libraries and troubleshoot issues more effectively (`issue #4517 <https://github.com/platformio/platformio-core/issues/4517>`_)
|
||||
* Added the ability to run only the `device monitor <https://docs.platformio.org/en/latest/core/userguide/device/cmd_monitor.html>`__ when using the `pio run -t monitor <https://docs.platformio.org/en/latest/core/userguide/cmd_run.html>`__ command, saving you time and resources by skipping the build process
|
||||
* Implemented a fix for shell injection vulnerabilities when converting INO files to CPP, ensuring your code is safe and secure (`issue #4532 <https://github.com/platformio/platformio-core/issues/4532>`_)
|
||||
* Restored the project generator for the `NetBeans IDE <https://docs.platformio.org/en/latest/integration/ide/netbeans.html>`__, providing you with more flexibility and options for your development workflow
|
||||
|
||||
6.1.6 (2023-01-23)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
2
docs
2
docs
Submodule docs updated: e9b309b593...ea46b38c80
@ -104,6 +104,8 @@ def cli(
|
||||
is_test_running = CTX_META_TEST_IS_RUNNING in ctx.meta
|
||||
|
||||
results = []
|
||||
only_monitor = "monitor" in target and len(target) == 1
|
||||
command_failed = False
|
||||
with fs.cd(project_dir):
|
||||
config = ProjectConfig.get_instance(project_conf)
|
||||
config.validate(environment)
|
||||
@ -111,6 +113,7 @@ def cli(
|
||||
if list_targets:
|
||||
return print_target_list(list(environment) or config.envs())
|
||||
|
||||
if not only_monitor:
|
||||
# clean obsolete build dir
|
||||
if not disable_auto_clean:
|
||||
build_dir = config.get("platformio", "build_dir")
|
||||
@ -148,10 +151,8 @@ def cli(
|
||||
ctx,
|
||||
env,
|
||||
config,
|
||||
environment,
|
||||
target,
|
||||
upload_port,
|
||||
monitor_port,
|
||||
jobs,
|
||||
program_args,
|
||||
is_test_running,
|
||||
@ -161,8 +162,11 @@ def cli(
|
||||
)
|
||||
|
||||
command_failed = any(r.get("succeeded") is False for r in results)
|
||||
|
||||
if not is_test_running and (command_failed or not silent) and len(results) > 1:
|
||||
if (
|
||||
not is_test_running
|
||||
and (command_failed or not silent)
|
||||
and len(results) > 1
|
||||
):
|
||||
print_processing_summary(results, verbose)
|
||||
|
||||
# Reset custom project config
|
||||
@ -170,6 +174,14 @@ def cli(
|
||||
|
||||
if command_failed:
|
||||
raise exception.ReturnErrorCode(1)
|
||||
|
||||
if "monitor" in target and "nobuild" not in target:
|
||||
ctx.invoke(
|
||||
device_monitor_cmd,
|
||||
port=monitor_port,
|
||||
environment=environment[0] if environment else None,
|
||||
)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
@ -177,10 +189,8 @@ def process_env(
|
||||
ctx,
|
||||
name,
|
||||
config,
|
||||
environments,
|
||||
targets,
|
||||
upload_port,
|
||||
monitor_port,
|
||||
jobs,
|
||||
program_args,
|
||||
is_test_running,
|
||||
@ -208,17 +218,6 @@ def process_env(
|
||||
if not is_test_running and (not silent or not result["succeeded"]):
|
||||
print_processing_footer(result)
|
||||
|
||||
if (
|
||||
result["succeeded"]
|
||||
and "monitor" in ep.get_build_targets()
|
||||
and "nobuild" not in ep.get_build_targets()
|
||||
):
|
||||
ctx.invoke(
|
||||
device_monitor_cmd,
|
||||
port=monitor_port,
|
||||
environment=environments[0] if environments else None,
|
||||
)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user