Mix.Tasks.Compile.Elixir
Compiles Elixir source files.
Elixir is smart enough to recompile only files that changed
and their dependencies. This means if lib/a.ex is invoking
a function defined over lib/b.ex, whenever lib/b.ex changes,
lib/a.ex is also recompiled.
Note it is important to recompile a file dependencies because often there are compilation time dependencies in between them.
Command line options
--force- forces compilation regardless of modification times;--no-docs- Do not attach documentation to compiled modules;--no-debug-info- Do not attach debug info to compiled modules;--ignore-module-conflict--warnings-as-errors- Treat warnings as errors and return a non-zero exit code
Configuration
:elixirc_paths- directories to find source files. Defaults to["lib"], can be configured as:[elixirc_paths: ["lib", "other"]]:elixirc_options- compilation options that apply to Elixir's compiler, they are::ignore_module_conflict,:docsand:debug_info. By default, uses the same behaviour as Elixir;:elixirc_exts- extensions to compile whenever there is a change:[compile_exts: [:ex]]:elixirc_watch_exts- extensions to watch in order to trigger a compilation:[elixirc_watch_exts: [:ex, :eex]]
Summary
| files_to_path(manifest, stale, all, path, on_start) | Compiles stale Elixir files |
| manifests() | Returns Elixir manifests |
| run(args) | Runs this task |
Functions
Compiles stale Elixir files.
It expects a manifest file, all stale files, all source files available (including the ones that are not stale) and a path where compiled files will be written to. All paths are required to be relative to the current working directory.
The manifest is written down with information including dependencies in between modules, which helps it recompile only the modules that have changed at runtime.