Add Application.compile_env/4 and Application.compile_env!/3 to read the compile-time environment inside macros
Calling Application.get_env/3 and friends in the module body is now discouraged, use Application.compile_env/3 instead
Module
14 changes across 10 versions
Changes by version
Add Application.compile_env/4 and Application.compile_env!/3 to read the compile-time environment inside macros
Calling Application.get_env/3 and friends in the module body is now discouraged, use Application.compile_env/3 instead
Allow any expression as first argument of compile_env
Warn if Application.compile_env or Application.compile_env! are called without a require
Do not add compile time deps on args to Application.compile_env/2 and Application.compile_env!/2
Warn if non-atom keys are given to put_env, get_env, fetch_env, and delete_env
Add Application.compile_env/3 and Application.compile_env!/2 for reading values at compilation time and tracking if they accidentally change during runtime
Ensure Application.spec/2 returns nil for unknown applications
Ensure spec/2 returns nil for unknown applications
Add spec/1 and spec/2 to retrieve application specification
Add get_application/1 to retrieve the application a given module belongs to
Add Application.fetch_env!/2, Application.loaded_applications/0 and Application.started_applications/0
Add an Application module with common functions to work with OTP applications
use Application.Behaviour is deprecated in favor of use Application