Skip to content

Commit

Permalink
Added new "pio run --monitor-port" option to specify custom device mo…
Browse files Browse the repository at this point in the history
…nitor port to the "monitor" target // Resolve #4337
  • Loading branch information
ivankravets committed Jun 29, 2022
1 parent 6bec593 commit 401f8a4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
5 changes: 3 additions & 2 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ PlatformIO Core 6
* Allowed to declare actions in the `PRE-type scripts <https://docs.platformio.org/en/latest/scripting/launch_types.html>`__ even if the target is not ready yet
* Allowed library maintainers to use Pre & Post Actions in the library `extraScript <https://docs.platformio.org/en/latest/manifests/library-json/fields/build/extrascript.html>`__

- Allowed to ``Import("projenv")`` in a library extra script (`issue #4305 <https://github.com/platformio/platformio-core/issues/4305>`_)
- Documented `Stringification <https://docs.platformio.org/en/latest/projectconf/section_env_build.html#stringification>`__ – converting a macro argument into a string constant (`issue #4310 <https://github.com/platformio/platformio-core/issues/4310>`_)
- Documented `Stringification <https://docs.platformio.org/en/latest/projectconf/section_env_build.html#stringification>`__ – converting a macro argument into a string constant (`issue #4310 <https://github.com/platformio/platformio-core/issues/4310>`_)
- Added new `pio run --monitor-port <https://docs.platformio.org/en/latest/core/userguide/cmd_run.html#cmdoption-pio-run-monitor-port>`__ option to specify custom device monitor port to the ``monitor`` target (`issue #4337 <https://github.com/platformio/platformio-core/issues/4337>`_)
- Added ``env.StringifyMacro(value)`` helper function for the `Advanced Scripting <https://docs.platformio.org/en/latest/scripting/index.html>`__
- Allowed to ``Import("projenv")`` in a library extra script (`issue #4305 <https://github.com/platformio/platformio-core/issues/4305>`_)
- Fixed an issue when the `build_unflags <https://docs.platformio.org/en/latest/projectconf/section_env_build.html#build-unflags>`__ operation ignores a flag value (`issue #4309 <https://github.com/platformio/platformio-core/issues/4309>`_)
- Fixed an issue when the `build_unflags <https://docs.platformio.org/en/latest/projectconf/section_env_build.html#build-unflags>`__ option was not applied to the ``ASPPFLAGS`` scope
- Fixed an issue on Windows OS when flags were wrapped to the temporary file while generating the `Compilation database "compile_commands.json" <https://docs.platformio.org/en/latest/integration/compile_commands.html>`__
Expand Down
2 changes: 1 addition & 1 deletion docs
8 changes: 7 additions & 1 deletion platformio/run/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
@click.option("-e", "--environment", multiple=True)
@click.option("-t", "--target", multiple=True)
@click.option("--upload-port")
@click.option("--monitor-port")
@click.option(
"-d",
"--project-dir",
Expand Down Expand Up @@ -83,6 +84,7 @@ def cli(
environment,
target,
upload_port,
monitor_port,
project_dir,
project_conf,
jobs,
Expand Down Expand Up @@ -146,6 +148,7 @@ def cli(
environment,
target,
upload_port,
monitor_port,
jobs,
program_args,
is_test_running,
Expand Down Expand Up @@ -174,6 +177,7 @@ def process_env(
environments,
targets,
upload_port,
monitor_port,
jobs,
program_args,
is_test_running,
Expand Down Expand Up @@ -207,7 +211,9 @@ def process_env(
and "nobuild" not in ep.get_build_targets()
):
ctx.invoke(
device_monitor_cmd, environment=environments[0] if environments else None
device_monitor_cmd,
port=monitor_port,
environment=environments[0] if environments else None,
)

return result
Expand Down
2 changes: 1 addition & 1 deletion platformio/test/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TestDirNotExistsError(UnitTestError, UserSideException):

MESSAGE = (
"A test folder '{0}' does not exist.\nPlease create 'test' "
"directory in the project root and put a test set.\n"
"directory in the project root and put a test suite.\n"
"More details about Unit "
"Testing: https://docs.platformio.org/en/latest/advanced/"
"unit-testing/index.html"
Expand Down

0 comments on commit 401f8a4

Please sign in to comment.