Skip to content

Commit 14ded16

Browse files
committed
Updated docs
1 parent 496b5cc commit 14ded16

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
@@ -176,17 +176,6 @@ The other fields are:
176176
macOS you can use the command `shasum -a 256 filename` to generate SHA-256 checksums. There are free options for
177177
Windows, including md5deep. There are also online utilities for generating checksums.
178178

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

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

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

275290
```json

Diff for: docs/platform-specification.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -766,14 +766,18 @@ tools.avrdude.config.path={path}/etc/avrdude.conf
766766
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"
767767
```
768768

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

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

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

0 commit comments

Comments
 (0)