diff options
author | Loïc Hoguin <[email protected]> | 2018-06-04 12:59:26 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-06-04 12:59:26 +0200 |
commit | 2b588340af501825f3ab03f2e76dba0353c98fae (patch) | |
tree | ad990a44d67f30e9804b606e0282ca9adfa37433 /docs/en/erlang.mk/1/guide/app.asciidoc | |
parent | 791b95225695b3badff7cc4bb4f0f1ed373c74de (diff) | |
download | ninenines.eu-2b588340af501825f3ab03f2e76dba0353c98fae.tar.gz ninenines.eu-2b588340af501825f3ab03f2e76dba0353c98fae.tar.bz2 ninenines.eu-2b588340af501825f3ab03f2e76dba0353c98fae.zip |
Update documentation for Gun 1.0
Diffstat (limited to 'docs/en/erlang.mk/1/guide/app.asciidoc')
-rw-r--r-- | docs/en/erlang.mk/1/guide/app.asciidoc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/docs/en/erlang.mk/1/guide/app.asciidoc b/docs/en/erlang.mk/1/guide/app.asciidoc index 94f8eb1a..9d5e9488 100644 --- a/docs/en/erlang.mk/1/guide/app.asciidoc +++ b/docs/en/erlang.mk/1/guide/app.asciidoc @@ -164,6 +164,42 @@ Any space before and after the value is dropped. xref:deps[Dependencies] are covered in details in the next chapter. +==== Application environment + +The `PROJECT_ENV` variable is used to set the application +environment: + +[source,make] +---- +define PROJECT_ENV +[ + {chips, [currysauce,{mushypeas,false}]}, + {pizza, [{size,large},{toppings,[anchovies]}]} +] +endef +---- + +If you have a large set of environment variables, you may find it +easier to use a separate file. Do this by including the following +in your Makefile: + +[source,make] +---- +PROJECT_ENV_FILE = src/env.src +PROJECT_ENV = $(subst \n,$(newline),$(shell cat $(PROJECT_ENV_FILE) | sed -e 's/$$/\\n/;')) +ebin/$(PROJECT).app:: $(PROJECT_ENV_FILE) +---- + +The file has the same contents as the `PROJECT_ENV` variable: + +[source,erlang] +---- +[ + {chips, [currysauce,{mushypeas,false}]}, + {pizza, [{size,large},{toppings,[anchovies]}]} +] +---- + ==== Legacy method The 'src/$(PROJECT).app.src' file is a legacy method of |