arduino / arduino-cli

Arduino command line tool
https://arduino.github.io/arduino-cli/latest/
GNU General Public License v3.0
4.33k stars 374 forks source link

Added possibility to set custom properties on upload/burn-bootloader/debug commands. #2693

Closed cmaglie closed 3 weeks ago

cmaglie commented 1 month ago

Please check if the PR fulfills these requirements

See how to contribute

What kind of change does this PR introduce?

As requested in https://github.com/arduino/arduino-cli/issues/2615 this PR adds the --build-property equivalent flag to the commands upload, burn-bootloader, debug and debug check. On each command, the flag has a slightly different name to emphasize that those are not strictly "build" properties: The command... ...provides the flag
compile --build-property
upload --upload-property
burn-bootloader --upload-property
debug --debug-property
debug check --debug-property

What is the current behavior?

No possibility to set custom properties on upload, burn-bootloader, debug, and debug check commands.

What is the new behavior?

$ arduino-cli upload -h | grep properties
      --upload-property stringArray   Override an upload property with a custom value. Can be used multiple times for multiple properties.

$ arduino-cli burn-bootloader -h | grep properties
      --upload-property stringArray   Override an upload property with a custom value. Can be used multiple times for multiple properties.

$ arduino-cli debug -h | grep properties
      --debug-property stringArray   Override an debug property with a custom value. Can be used multiple times for multiple properties.

$ arduino-cli debug check -h | grep properties
      --debug-property stringArray   Override an debug property with a custom value. Can be used multiple times for multiple properties.

Does this PR introduce a breaking change, and is titled accordingly?

No.

Other information

Fix #2615

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 70.32967% with 27 lines in your changes missing coverage. Please review.

Project coverage is 67.66%. Comparing base (c5812ee) to head (324c30f). Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
commands/service_upload.go 16.66% 14 Missing and 1 partial :warning:
internal/cli/burnbootloader/burnbootloader.go 20.00% 8 Missing :warning:
commands/service_debug_config.go 76.92% 2 Missing and 1 partial :warning:
commands/service_upload_burnbootloader.go 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2693 +/- ## ========================================== - Coverage 67.67% 67.66% -0.01% ========================================== Files 234 234 Lines 22176 22205 +29 ========================================== + Hits 15007 15026 +19 - Misses 5990 5998 +8 - Partials 1179 1181 +2 ``` | [Flag](https://app.codecov.io/gh/arduino/arduino-cli/pull/2693/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arduino) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/arduino/arduino-cli/pull/2693/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arduino) | `67.66% <70.32%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arduino#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.