Skip to content

Commit f759b08

Browse files
authored
[skip changelog] Fully document library layouts in specification (#1458)
Arduino library authors may chose from multiple structures, each of which have different implications for the compilation of the library source files. The specification explains this in a somewhat simplistic manner as "1.5 format" and "1.0 format". That is sufficient for most, but does not provide a complete picture. Feedback indicated that more advanced users were left wanting complete documentation, which is provided here. The subject is not well suited for description via prose, so a chart and table are employed instead. The chart is defined in the DOT graph description language.
1 parent 1a3250b commit f759b08

File tree

3 files changed

+165
-0
lines changed

3 files changed

+165
-0
lines changed

Diff for: docs/img/library-layout.dot

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// See: https://www.graphviz.org/documentation/
2+
digraph {
3+
// This generates library-layout.png using the following command:
4+
// dot -Tsvg -olibrary-layout.svg library-layout.dot
5+
graph [
6+
splines=line
7+
]
8+
node [
9+
shape=box
10+
]
11+
12+
subgraph {
13+
// This subgraph provides the labels on left margin
14+
node [
15+
margin="0.0,0.0"
16+
shape=none
17+
width=0.0
18+
]
19+
"Metadata:" -> "Format:" -> "Structure:" -> "Layout:" [style=invis]
20+
}
21+
22+
subgraph cluster1 {
23+
peripheries=0
24+
"library.properties" [height=1.0 margin="0.0,0.0" shape=diamond width=0.0]
25+
"library.properties" -> "1.5" [label="yes"]
26+
"library.properties" -> "1.0" [label="no"]
27+
subgraph cluster2 {
28+
peripheries=0
29+
rank=same
30+
"1.5"
31+
"1.0"
32+
}
33+
"1.5" -> "src/"
34+
"src/" [shape=diamond]
35+
"src/" -> "recursive" [label=" yes"]
36+
"src/" -> "flat" [label="no"]
37+
"1.0" -> "flat"
38+
}
39+
}

Diff for: docs/img/library-layout.svg

+117
Loading

Diff for: docs/library-specification.md

+9
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,15 @@ only needs to run on Arduino IDE 1.5.x+, we recommend placing all source code in
163163
recursive compilation of nested source folders, its code must be in the src/ folder (since Arduino IDE 1.0.x doesn’t
164164
support recursive compilation, backwards compatibility wouldn’t be possible anyway).
165165

166+
##### Library layout
167+
168+
![Library layout](img/library-layout.svg)
169+
170+
| Layout | root compiled | `src` compiled | `utility` compiled |
171+
| ------------- | ------------- | -------------- | ------------------ |
172+
| **recursive** | no | recursively | no |
173+
| **flat** | yes | no | yes |
174+
166175
#### Precompiled binaries
167176

168177
The `precompiled` field of [library.properties](#libraryproperties-file-format) enables support for the use of

0 commit comments

Comments
 (0)