Skip to content

Commit 5193612

Browse files
Update documentation regarding sketch projects
1 parent 88d00a9 commit 5193612

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: docs/sketch-project-file.md

+15
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ profiles:
3333
- <LIB_NAME> (<LIB_VERSION>)
3434
3535
...more profiles here...
36+
37+
default_profile: <DEFAULT_PROFILE_NAME>
3638
```
3739

3840
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:
5052
- `libraries:` is a section where the required libraries to build the project are defined. This section is optional.
5153
- `<LIB_VERSION>` is the version required for the library, for example, `1.0.0`.
5254
- `<USER_NOTES>` is a free text string available to the developer to add comments. This field is optional.
55+
- `<DEFAULT_PROFILE_NAME>` is the profile used by default (more on that later)
5356

5457
A complete example of a sketch project file may be the following:
5558

@@ -95,6 +98,8 @@ profiles:
9598
- ArduinoIoTCloud (1.0.2)
9699
- Arduino_ConnectionHandler (0.6.4)
97100
- TinyDHT sensor library (1.1.0)
101+
102+
default_profile: nanorp
98103
```
99104

100105
### Building a sketch
@@ -116,6 +121,16 @@ not be used in any way. In other words, the build is isolated from the system an
116121
specified in the profile: this will ensure that the build is portable and reproducible independently from the platforms
117122
and libraries installed in the system.
118123

124+
### Using a default profile
125+
126+
If a `default_profile` is specified in the `sketch.yaml` then the “classic” compile command:
127+
128+
```
129+
arduino-cli compile [sketch]
130+
```
131+
132+
will, instead, trigger a profile-based build using the default profile indicated in the `sketch.yaml`.
133+
119134
## Default flags for Arduino CLI usage
120135

121136
The sketch project file may be used to set the default value for some command line flags of the Arduino CLI, in

0 commit comments

Comments
 (0)