Skip to content

Add Arduino CLI compile flags input #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 8, 2021
Merged

Add Arduino CLI compile flags input #18

merged 2 commits into from
Feb 8, 2021

Conversation

per1234
Copy link
Collaborator

@per1234 per1234 commented Feb 7, 2021

This input allows the user to customize the sketch compilation process by defining arbitrary flags to be added to the
arduino-cli compile command.

In order to be as flexible as possible, the input uses a YAML list format:

cli-compile-flags: |
  - --build-property
  - compiler.cpp.extra_flags="-DFOO="hello world"" -DPIN=2
  - --export-binaries

Closes #16

This input allows the user to customize the sketch compilation process by defining arbitrary flags to be added to the
`arduino-cli compile` command.

In order to be as flexible as possible, the input uses a YAML list format:

cli-compile-flags: |
  - --build-property
  - compiler.cpp.extra_flags="-DFOO="hello world"" -DPIN=2
  - --export-binaries
A sketch was added that is designed to fail compilation if the `arduino-cli compile` command does not contain the flags
specified via the input. Because the `--build-property` flag used in the test was not present in Arduino CLI 0.13.0 (the
equivalent flag was `--build-properties` at that time), it was necessary to update the Arduino CLI version used by the
action in the test.
@per1234
Copy link
Collaborator Author

per1234 commented Feb 7, 2021

The failure of the "Lint Python code" CI workflow run is unrelated to the change made in this PR. It will be fixed by https://github.com/per1234/compile-sketches/tree/codecov-badge

The failure of the "Run integration tests" is caused by the introduction of the new test sketch. The deltas values in the golden report won't be matched until the next run when the sketch is present in the deltas base ref.

Copy link
Contributor

@aentinger aentinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great feature 👍 Thank you @per1234 🚀

@aentinger aentinger merged commit 656a871 into arduino:main Feb 8, 2021
@gasagna
Copy link

gasagna commented May 31, 2023

Had to dig out this thread to understand how to use the cli-compile-flags input. Maybe worth adding this example to the docs.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for --build-property
3 participants