diff --git a/docs/img/library-layout.dot b/docs/img/library-layout.dot new file mode 100644 index 00000000000..9afa87b93c5 --- /dev/null +++ b/docs/img/library-layout.dot @@ -0,0 +1,39 @@ +// See: https://www.graphviz.org/documentation/ +digraph { + // This generates library-layout.png using the following command: + // dot -Tsvg -olibrary-layout.svg library-layout.dot + graph [ + splines=line + ] + node [ + shape=box + ] + + subgraph { + // This subgraph provides the labels on left margin + node [ + margin="0.0,0.0" + shape=none + width=0.0 + ] + "Metadata:" -> "Format:" -> "Structure:" -> "Layout:" [style=invis] + } + + subgraph cluster1 { + peripheries=0 + "library.properties" [height=1.0 margin="0.0,0.0" shape=diamond width=0.0] + "library.properties" -> "1.5" [label="yes"] + "library.properties" -> "1.0" [label="no"] + subgraph cluster2 { + peripheries=0 + rank=same + "1.5" + "1.0" + } + "1.5" -> "src/" + "src/" [shape=diamond] + "src/" -> "recursive" [label=" yes"] + "src/" -> "flat" [label="no"] + "1.0" -> "flat" + } +} diff --git a/docs/img/library-layout.svg b/docs/img/library-layout.svg new file mode 100644 index 00000000000..dc1f7bf72a7 --- /dev/null +++ b/docs/img/library-layout.svg @@ -0,0 +1,117 @@ + + + + + + + + +cluster1 + + +cluster2 + + + +Metadata: +Metadata: + + + +Format: +Format: + + + + +Structure: +Structure: + + + + +Layout: +Layout: + + + + +library.properties + +library.properties + + + +1.5 + +1.5 + + + +library.properties->1.5 + + +yes + + + +1.0 + +1.0 + + + +library.properties->1.0 + + +no + + + +src/ + +src/ + + + +1.5->src/ + + + + + +flat + +flat + + + +1.0->flat + + + + + +recursive + +recursive + + + +src/->recursive + + + yes + + + +src/->flat + + +no + + + diff --git a/docs/library-specification.md b/docs/library-specification.md index f8492e6e42c..232f67829aa 100644 --- a/docs/library-specification.md +++ b/docs/library-specification.md @@ -163,6 +163,15 @@ only needs to run on Arduino IDE 1.5.x+, we recommend placing all source code in recursive compilation of nested source folders, its code must be in the src/ folder (since Arduino IDE 1.0.x doesn’t support recursive compilation, backwards compatibility wouldn’t be possible anyway). +##### Library layout + +![Library layout](img/library-layout.svg) + +| Layout | root compiled | `src` compiled | `utility` compiled | +| ------------- | ------------- | -------------- | ------------------ | +| **recursive** | no | recursively | no | +| **flat** | yes | no | yes | + #### Precompiled binaries The `precompiled` field of [library.properties](#libraryproperties-file-format) enables support for the use of