Skip to content

Commit 0e4559b

Browse files
committed
Updated docs
1 parent bf834bf commit 0e4559b

File tree

2 files changed

+40
-29
lines changed

2 files changed

+40
-29
lines changed

docs/sketch-build-process.md

+16-15
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@ generated for the path to each library dependency and appended to the
5252
If multiple libraries contain a file that matches the `#include` directive, the priority is determined by applying the
5353
following rules, one by one in this order, until a rule determines a winner:
5454

55-
1. A library that has been specified using the [`--library` option](commands/arduino-cli_compile.md#options) of
56-
`arduino-cli compile` wins against a library in other locations
55+
1. A library has been specified using the [`--library` option](commands/arduino-cli_compile.md#options) of
56+
`arduino-cli compile`.
57+
1. A library is found in the `libraries` subfolder of the sketch.
5758
1. A library that is architecture compatible wins against a library that is not architecture compatible (see
5859
[**Architecture Matching**](#architecture-matching))
5960
1. A library with both [library name](#library-name-priority) and [folder name](#folder-name-priority) matching the
60-
include wins
61-
1. A library that has better "library name priority" or "folder name priority" wins (see
62-
[**Library Name Priority**](#library-name-priority) and [**Folder Name Priority**](#folder-name-priority))
63-
1. A library that is architecture optimized wins against a library that is not architecture optimized (see
64-
[**Architecture Matching**](#architecture-matching))
65-
1. A library that has a better "location priority" wins (see [**Location Priority**](#location-priority))
66-
1. A library that has a folder name with a better score using the "closest-match" algorithm wins
67-
1. A library that has a folder name that comes first in alphanumeric order wins
61+
include.
62+
1. A library has better "library name priority" or "folder name priority" (see
63+
[**Library Name Priority**](#library-name-priority) and [**Folder Name Priority**](#folder-name-priority)).
64+
1. A library is architecture optimized (see [**Architecture Matching**](#architecture-matching)).
65+
1. A library has a better "location priority" (see [**Location Priority**](#location-priority)).
66+
1. A library has a folder name with a better score using the "closest-match" algorithm.
67+
1. A library has a folder name that comes first in alphanumeric order.
6868

6969
### Architecture Matching
7070

@@ -126,14 +126,15 @@ The "location priority" is determined as follows (in order of highest to lowest
126126

127127
1. The library is under a custom libraries path specified via the
128128
[`--libraries` option](commands/arduino-cli_compile.md#options) of `arduino-cli compile` (in decreasing order of
129-
priority when multiple custom paths are defined)
130-
1. The library is under the `libraries` subfolder of the IDE's sketchbook or Arduino CLI's user directory
129+
priority when multiple custom paths are defined).
130+
1. The library is under the `libraries` subfolder of the sketch.
131+
1. The library is under the `libraries` subfolder of the IDE's sketchbook or Arduino CLI's user directory.
131132
1. The library is bundled with the board platform/core
132-
([`{runtime.platform.path}/libraries`](platform-specification.md#global-predefined-properties))
133+
([`{runtime.platform.path}/libraries`](platform-specification.md#global-predefined-properties)).
133134
1. The library is bundled with the [referenced](platform-specification.md#referencing-another-core-variant-or-tool)
134-
board platform/core
135+
board platform/core.
135136
1. The library is bundled with the Arduino IDE (this location is determined by the Arduino CLI configuration setting
136-
`directories.builtin.libraries`)
137+
`directories.builtin.libraries`).
137138

138139
#### Location priorities in Arduino Web Editor
139140

docs/sketch-specification.md

+24-14
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ Files added to the sketch via the Arduino IDE's **Sketch > Add File...** are pla
7272
The Arduino IDE's **File > Save As...** only copies the code files in the sketch root folder and the full contents of
7373
the `data` folder, so any non-code files outside the `data` folder are stripped.
7474

75+
### `libraries` subfolder
76+
77+
The `libraries` folder is used to store libraries compiled with the sketch. This folder should be used to store
78+
libraries that have been patched or to store libraries that are not available through the official library repository.
79+
80+
- This feature is available since Arduino CLI 1.1.1
81+
- This feature is not yet available in Arduino IDE and Arduino Web Editor.
82+
7583
### Metadata
7684

7785
#### `sketch.json`
@@ -118,25 +126,27 @@ Web Editor.
118126
### Sketch file structure example
119127

120128
```
121-
Foo
129+
MotorController
122130
|_ arduino_secrets.h
123-
|_ Abc.ino
124-
|_ Def.cpp
125-
|_ Def.h
126-
|_ Foo.ino
127-
|_ Ghi.c
128-
|_ Ghi.h
129-
|_ Jkl.h
130-
|_ Jkl.S
131+
|_ motors.ino
132+
|_ defs.cpp
133+
|_ defs.h
134+
|_ MotorController.ino
135+
|_ someASM.h
136+
|_ someASM.S
131137
|_ sketch.yaml
132138
|_ data
133139
| |_ Schematic.pdf
140+
|_ libraries
141+
| |_ SomeLib
142+
| |_ library.properties
143+
| |_ src
144+
| |_ SomeLib.h
145+
| |_ SomeLib.cpp
134146
|_ src
135-
|_ SomeLib
136-
|_ library.properties
137-
|_ src
138-
|_ SomeLib.h
139-
|_ SomeLib.cpp
147+
|_ encoders
148+
|_ encoders.h
149+
|_ encoders.cpp
140150
```
141151

142152
## Sketchbook

0 commit comments

Comments
 (0)