summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kousik Kumar <kousikk@google.com> 2022-02-08 23:02:29 -0500
committer Junfeng Wu <wujunfen@google.com> 2022-02-09 05:08:11 +0000
commitd13fcd8227e872dfec165f073067c05ce9583e66 (patch)
tree47c4a7501e9850915edca995d35303b77f2cd5d7
parentdef9bf2c1c22e662bec5d0a378b281aa265a1f2c (diff)
Add sample config file
Also added documentation on how to use these config files Change-Id: Ic8080bbdceb28da27af521020e671244df452ee4 Bug: 213446344
-rw-r--r--README.md20
-rw-r--r--example_config.json6
2 files changed, 26 insertions, 0 deletions
diff --git a/README.md b/README.md
index 18c660445..caffd3d4b 100644
--- a/README.md
+++ b/README.md
@@ -550,6 +550,26 @@ logic receives module definitions parsed into Go structures using reflection
and produces build rules. The build rules are collected by blueprint and
written to a [ninja](http://ninja-build.org) build file.
+## Environment Variables Config File
+
+Soong can optionally load environment variables from a pre-specified
+configuration file during startup. These environment variables can be used
+to control the behavior of the build. For example, these variables can determine
+whether remote-execution should be used for the build or not.
+
+The `ANDROID_BUILD_ENVIRONMENT_CONFIG_DIR` environment variable specifies the
+directory in which the config file should be searched for. The
+`ANDROID_BUILD_ENVIRONMENT_CONFIG` variable determines the name of the config
+file to be searched for within the config directory. For example, the following
+build comand will load `ENV_VAR_1` and `ENV_VAR_2` environment variables from
+the `example_config.json` file inside the `build/soong` directory.
+
+```
+ANDROID_BUILD_ENVIRONMENT_CONFIG_DIR=build/soong \
+ ANDROID_BUILD_ENVIRONMENT_CONFIG=example_config \
+ build/soong/soong_ui.bash
+```
+
## Other documentation
* [Best Practices](docs/best_practices.md)
diff --git a/example_config.json b/example_config.json
new file mode 100644
index 000000000..7489840a9
--- /dev/null
+++ b/example_config.json
@@ -0,0 +1,6 @@
+{
+ "env": {
+ "ENV_VAR_1": "Value1",
+ "ENV_VAR_2": "Value2"
+ }
+}