Skip to content

Commit b64f1a3

Browse files
committed
Updated docs
1 parent 379e140 commit b64f1a3

File tree

2 files changed

+34
-15
lines changed

2 files changed

+34
-15
lines changed

Diff for: docs/package_index_json-specification.md

+26-11
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,6 @@ The other fields are:
177177
macOS you can use the command `shasum -a 256 filename` to generate SHA-256 checksums. There are free options for
178178
Windows, including md5deep. There are also online utilities for generating checksums.
179179

180-
##### How a tool's path is determined in platform.txt
181-
182-
When the IDE needs a tool, it downloads the corresponding archive file and unpacks the content into a private folder
183-
that can be referenced from `platform.txt` using one of the following properties:
184-
185-
- `{runtime.tools.TOOLNAME-VERSION.path}`
186-
- `{runtime.tools.TOOLNAME.path}`
187-
188-
For example, to obtain the avr-gcc 4.8.1 folder we can use `{runtime.tools.avr-gcc-4.8.1-arduino5.path}` or
189-
`{runtime.tools.avr-gcc.path}`.
190-
191180
### Platforms definitions
192181

193182
Finally, let's see how `PLATFORMS` are made.
@@ -271,6 +260,32 @@ rules Arduino IDE follows for parsing versions
271260
Note: if you miss a bracket in the JSON index, then add the URL to your Preferences, and open Boards Manager it can
272261
cause the Arduino IDE to no longer load until you have deleted the file from your arduino15 folder.
273262

263+
#### How a tool's path is determined in platform.txt
264+
265+
When the IDE needs a tool, it downloads the corresponding archive file and unpacks the content into a private folder
266+
that can be referenced from `platform.txt` using one of the following properties:
267+
268+
- `{runtime.tools.TOOLNAME-VERSION.path}`
269+
- `{runtime.tools.TOOLNAME.path}`
270+
271+
For example, to obtain the avr-gcc 4.8.1 folder we can use `{runtime.tools.avr-gcc-4.8.1.path}` or
272+
`{runtime.tools.avr-gcc.path}`.
273+
274+
In general the same tool may be provided by different platforms (for example the Arduino AVR platform may provide an
275+
`arduino:avr-gcc` and another 3rd party platform may provide their own `3rdparty:avr-gcc`). The rules to disambiguate
276+
are as follows:
277+
278+
- The property `{runtime.tools.TOOLNAME.path}` points, in order of priority, to:
279+
280+
1. the tool, version and packager specified via `toolsDependencies` in the `package_index.json`
281+
1. the highest version of the tool provided by the packager of the current platform
282+
1. the highest version of the tool provided by any other packager (in case of tie, the first packager in alphabetical
283+
order wins)
284+
285+
- The property `{runtime.tools.TOOLNAME-VERSION.path}` points, in order of priority, to:
286+
1. the tool and version provided by the packager of the current platform
287+
1. the tool and version provided by any other packager (in case of tie, the first packager in alphabetical order wins)
288+
274289
### Example JSON index file
275290

276291
```json

Diff for: docs/platform-specification.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -765,14 +765,18 @@ tools.avrdude.config.path={path}/etc/avrdude.conf
765765
tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" -p{build.mcu} -c{upload.port.protocol} -P{upload.port.address} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i"
766766
```
767767

768-
A **{runtime.tools.TOOL_NAME.path}** and **{runtime.tools.TOOL_NAME-TOOL_VERSION.path}** property is generated for the
769-
tools of Arduino AVR Boards and any other platform installed via Boards Manager. **{runtime.tools.TOOL_NAME.path}**
770-
points to the latest version of the tool available.
771-
772768
The tool configuration properties are available globally without the prefix. For example, the **tools.avrdude.cmd.path**
773769
property can be used as **{cmd.path}** inside the recipe, and the same happens for all the other avrdude configuration
774770
variables.
775771

772+
### How to retrieve tools path via `{runtime.tools.*}` properties
773+
774+
A **{runtime.tools.TOOLNAME.path}** and **{runtime.tools.TOOLNAME-TOOLVERSION.path}** property is generated for the
775+
tools provided by the current platform and for any other platform installed via Boards Manager.
776+
777+
See [`{runtime.tools.*.path}` rules](package_index_json-specification.md#how-a-tools-path-is-determined-in-platformtxt)
778+
for details on how the runtime properties are determined.
779+
776780
### Environment variables
777781

778782
All the tools launched to compile or upload a sketch will have the following environment variable set:

0 commit comments

Comments
 (0)