Skip to content

Commit 6eae590

Browse files
Calinouskyace65
authored andcommitted
Document reading project settings with overrides taken into account in Feature tags
1 parent d8fecf7 commit 6eae590

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tutorials/export/feature_tags.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,28 @@ in many sections of the project settings.
184184

185185
.. image:: img/feature_tags4.webp
186186

187+
Taking feature tags into account when reading project settings
188+
--------------------------------------------------------------
189+
190+
By default, feature tags are **not** taken into account when reading project settings
191+
using the typical approaches (:ref:`ProjectSettings.get_setting<class_ProjectSettings_method_get_setting>`
192+
or :ref:`ProjectSettings.get <class_Object_private_method__get>`).
193+
Instead, you must use :ref:`ProjectSettings.get_setting_with_override <class_ProjectSettings_method_get_setting>`.
194+
195+
For example, with the following project settings:
196+
197+
::
198+
199+
[section]
200+
201+
subsection/example = "Release"
202+
subsection/example.debug = "Debug"
203+
204+
Using ``ProjectSettings.get_setting("section/subsection/example")`` will return
205+
``"Release"`` regardless of whether a debug build is currently running. On the
206+
other hand, ``ProjectSettings.get_setting_with_override("section/subsection/example")``
207+
will obey feature tags and will return ``"Debug"`` if using a debug build.
208+
187209
Customizing the build
188210
---------------------
189211

0 commit comments

Comments
 (0)