From 0b7ce9d45f534cd90be125302b47a147580ee383 Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 11 Jul 2025 11:30:22 -0700 Subject: [PATCH] [skip changelog] Document Arduino CLI support for global platform.txt, and all recognized paths Previously, the Platform Specification incorrectly stated that the "global platform.txt" feature is only supported by Arduino IDE. In fact, it is also perfectly well supported when using Arduino CLI. The cause of the misunderstanding is due to the documentation only mentioning that the file is recognized in the Arduino IDE bundled packages path. Since that concept is specific to Arduino IDE 1.x (Arduino IDE 2.x did not exist at the time this documentation was written, so the relevant IDE major version series was not specified), the assumption was made that the feature was only available when using Arduino IDE 1.x. However, the system is actually general to all packages folders, not exclusively the IDE bundled packages folder. The additional packages folders locations at which global platform.txt files will be recognized by Arduino CLI and Arduino IDE 2.x, in addition to 1.x, are hereby documented. --- docs/platform-specification.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/platform-specification.md b/docs/platform-specification.md index 652b7348878..43d7bac827a 100644 --- a/docs/platform-specification.md +++ b/docs/platform-specification.md @@ -522,9 +522,17 @@ commands to run to compile the sketch), but the `post*` hooks and all compile co ## Global platform.txt -Properties defined in a platform.txt created in the **hardware** subfolder of the Arduino IDE installation folder will -be used for all platforms and will override local properties. This feature is currently only available when using the -Arduino IDE. +Properties defined in a platform.txt file located in the root of any of the packages folders will be used for all +platforms and will override local properties. + +The packages folder locations are: + +- `{directories.data}/packages`
(where `{directories.data}` is the path from the `directories.data` + [configuration key](configuration.md)) +- `{directories.user}/hardware`
(where `{directories.user}` is the path from the `directories.user` + [configuration key](configuration.md), or Arduino IDE "Sketchbook location" preference) +- `{Arduino IDE installation}/hardware` (Arduino IDE 1.x only)
(where `{Arduino IDE installation}` is the path of + the Arduino IDE installation folder) ## platform.local.txt