From 6eae590bee1a3ba88a9a7937d504392cea242876 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 9 Jan 2025 00:50:01 +0100 Subject: [PATCH] Document reading project settings with overrides taken into account in Feature tags --- tutorials/export/feature_tags.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tutorials/export/feature_tags.rst b/tutorials/export/feature_tags.rst index a31ac6b4c..d46065315 100644 --- a/tutorials/export/feature_tags.rst +++ b/tutorials/export/feature_tags.rst @@ -184,6 +184,28 @@ in many sections of the project settings. .. image:: img/feature_tags4.webp +Taking feature tags into account when reading project settings +-------------------------------------------------------------- + +By default, feature tags are **not** taken into account when reading project settings +using the typical approaches (:ref:`ProjectSettings.get_setting` +or :ref:`ProjectSettings.get `). +Instead, you must use :ref:`ProjectSettings.get_setting_with_override `. + +For example, with the following project settings: + +:: + + [section] + + subsection/example = "Release" + subsection/example.debug = "Debug" + +Using ``ProjectSettings.get_setting("section/subsection/example")`` will return +``"Release"`` regardless of whether a debug build is currently running. On the +other hand, ``ProjectSettings.get_setting_with_override("section/subsection/example")`` +will obey feature tags and will return ``"Debug"`` if using a debug build. + Customizing the build ---------------------