aboutsummaryrefslogtreecommitdiff
path: root/Changes.md
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2022-11-07 17:07:25 -0800
committerCole Faust <colefaust@google.com>2022-11-07 17:52:28 -0800
commitcb30a801c51bd6432e8401e4de84f8f68f63fd74 (patch)
treead84a922abc3e76033837be5480aa17deeb367cf /Changes.md
parent94c9b20f1d8adb5660d227db23f9a1e33eae64c2 (diff)
downloadbuild-cb30a801c51bd6432e8401e4de84f8f68f63fd74.tar.gz
Document changes to soong config string variables
Bug: 220375749 Test: N/A Change-Id: Ie7a621eec40488ef63f74d70a91dc5849de2f90a
Diffstat (limited to 'Changes.md')
-rw-r--r--Changes.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/Changes.md b/Changes.md
index 3ad26417b2..8979e3091c 100644
--- a/Changes.md
+++ b/Changes.md
@@ -860,6 +860,39 @@ These are all exported from envsetup.sh, but don't have clear equivalents within
the makefile system. If you need one of them, you'll have to set up your own
version.
+## Soong config variables
+
+### Soong config string variables must list all values they can be set to
+
+In order to facilitate the transition to bazel, all soong_config_string_variables
+must only be set to a value listed in their `values` property, or an empty string.
+It is a build error otherwise.
+
+Example Android.bp:
+```
+soong_config_string_variable {
+ name: "my_string_variable",
+ values: [
+ "foo",
+ "bar",
+ ],
+}
+
+soong_config_module_type {
+ name: "my_cc_defaults",
+ module_type: "cc_defaults",
+ config_namespace: "my_namespace",
+ variables: ["my_string_variable"],
+ properties: [
+ "shared_libs",
+ "static_libs",
+ ],
+}
+```
+Product config:
+```
+$(call soong_config_set,my_namespace,my_string_variable,baz) # Will be an error as baz is not listed in my_string_variable's values.
+```
[build/soong/Changes.md]: https://android.googlesource.com/platform/build/soong/+/master/Changes.md
[build/soong/docs/best_practices.md#headers]: https://android.googlesource.com/platform/build/soong/+/master/docs/best_practices.md#headers