mix deps documentation:
:runtime- whether the dependency is part of runtime applications. If the
:applicationskey is not provided in
def applicationin your mix.exs file, Mix will automatically included all dependencies as a runtime application, except if
runtime: falseis given. Defaults to true.
mix compile.app docs:
:applications- all applications your application depends on at runtime. By default, this list is automatically inferred from your dependencies. Mix and other tools use the application list in order to start your dependencies before starting the application itself.
Does this mean that adding
runtime: false to a dependency would make it not started as part of the application's supervision tree, but its functions would be available at compile-time?
Like you mentioned, that's exactly the case. Marking a dependency
runtime: false will not start it as part of the application supervision tree when your main application is started.
Before Elixir 1.4 we had to individually specify the applications that needed to be started by putting them in
def application do
[applications: [:logger, :bamboo]]
Now we use
extra_applications instead and mark the specific dependencies
runtime: false to remove them from the applications list at runtime.