Skip to content

Commit d11f318

Browse files
committed
Improve docs for the "extends" option
Resolve platformio/platformio-core#3952
1 parent c3a7367 commit d11f318

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

projectconf/section_env_advanced.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,39 @@ Example:
5050
build_type = debug
5151
build_flags = -D DEBUG
5252
53+
.. warning::
54+
Please note that the ``extends`` option doesn't merge values from multiple sections
55+
or environments. If multiple items specified in the extends field then only values
56+
from the latter one will be used in the final configuration. For example:
57+
58+
.. code-block:: ini
59+
60+
[base]
61+
platform = teensy
62+
framework = arduino
63+
board = teensy31
64+
65+
[lib_deps1]
66+
lib_deps =
67+
monstrenyatko/ArduinoMqtt @ ^1.5.1
68+
bblanchon/ArduinoJson @ ^6.18.3
69+
knolleary/PubSubClient @ ^2.8
70+
71+
[lib_deps2]
72+
lib_deps =
73+
sstaub/Ticker @ ^4.3.0
74+
thijse/ArduinoLog @ ^1.1.1
75+
adafruit/RTClib @ ^1.14.0
76+
77+
[env:final]
78+
extends = base, lib_deps1, lib_deps2
79+
; The values from `lib_deps2` will override the values from lib_deps1, so
80+
; the final `lib_deps` option will be equivalent to the following:
81+
; lib_deps =
82+
; sstaub/Ticker @ ^4.3.0
83+
; thijse/ArduinoLog @ ^1.1.1
84+
; adafruit/RTClib @ ^1.14.0
85+
5386
5487
.. _projectconf_extra_scripts:
5588

0 commit comments

Comments
 (0)