Skip to content

Commit 092529f

Browse files
authored
Merge pull request #10488 from Calinou/feature-tags-get-setting-with-override
Document reading project settings with overrides taken into account in Feature tags
2 parents 19cabbc + 6eae590 commit 092529f

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
@@ -188,6 +188,28 @@ in many sections of the project settings.
188188

189189
.. image:: img/feature_tags4.webp
190190

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

0 commit comments

Comments
 (0)