diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index a7eeca5eaec..a5e274efe65 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -2,6 +2,13 @@ Here you can find a list of migration guides to handle breaking changes between releases of the CLI. +## 0.34.0 + +### `compile [sketch]` and `upload -p [port] [sketch]` now use the `default_profile` + +The command `compile [sketch]` now compiles using the `default_profile` specified in the `sketch.yaml` file. The command +`upload -p [port] [sketch]` can now obtain the `fqbn` from the `default_profile`. + ## 0.33.0 ### gRPC `cc.arduino.cli.commands.v1.Compile` command now return expanded build_properties by default. diff --git a/docs/sketch-project-file.md b/docs/sketch-project-file.md index 01a5607c8db..c2f278e4c7f 100644 --- a/docs/sketch-project-file.md +++ b/docs/sketch-project-file.md @@ -33,6 +33,8 @@ profiles: - () ...more profiles here... + +default_profile: ``` There is an optional `profiles:` section containing all the profiles. Each field in a profile is mandatory (unless noted @@ -50,6 +52,7 @@ otherwise below). The available fields are: - `libraries:` is a section where the required libraries to build the project are defined. This section is optional. - `` is the version required for the library, for example, `1.0.0`. - `` is a free text string available to the developer to add comments. This field is optional. +- `` is the profile used by default (more on that later) A complete example of a sketch project file may be the following: @@ -95,6 +98,8 @@ profiles: - ArduinoIoTCloud (1.0.2) - Arduino_ConnectionHandler (0.6.4) - TinyDHT sensor library (1.1.0) + +default_profile: nanorp ``` ### Building a sketch @@ -116,6 +121,16 @@ not be used in any way. In other words, the build is isolated from the system an specified in the profile: this will ensure that the build is portable and reproducible independently from the platforms and libraries installed in the system. +### Using a default profile + +If a `default_profile` is specified in the `sketch.yaml` then the “classic” compile command: + +``` +arduino-cli compile [sketch] +``` + +will, instead, trigger a profile-based build using the default profile indicated in the `sketch.yaml`. + ## Default flags for Arduino CLI usage The sketch project file may be used to set the default value for some command line flags of the Arduino CLI, in