mix compile

A meta task that compiles source files.

It simply runs the compilers registered in your project and returns a tuple with the compilation status and a list of diagnostics.

Configuration

  • :compilers - compilers to run, defaults to Mix.compilers/0, which are [:yecc, :leex, :erlang, :elixir, :xref, :app].

  • :consolidate_protocols - when true, runs protocol consolidation via the compile.protocols task. The default value is true.

  • :build_embedded - when true, embeds all code and priv content in the _build directory instead of using symlinks.

  • :build_path - the directory where build artifacts should be written to. This option is intended only for child apps within a larger umbrella application so that each child app can use the common _build directory of the parent umbrella. In a non-umbrella context, configuring this has undesirable side-effects (such as skipping some compiler checks) and should be avoided.

Compilers

To see documentation for each specific compiler, you must invoke help directly for the compiler command:

mix help compile.elixir
mix help compile.erlang

You can get a list of all compilers by running:

mix compile --list

Command line options

  • --list - lists all enabled compilers
  • --no-archives-check - skips checking of archives
  • --no-deps-check - skips checking of dependencies
  • --force - forces compilation
  • --return-errors - return error status and diagnostics instead of exiting on error

Summary

Functions

compilers()

Returns all compilers

manifests()

Returns manifests for all compilers

run(args)

Receives command-line arguments and performs compilation. If it produces errors, warnings, or any other diagnostic information, it should return a tuple with the status and a list of diagnostics

Functions

compilers()

Returns all compilers.

manifests()

Returns manifests for all compilers.

run(args)

Receives command-line arguments and performs compilation. If it produces errors, warnings, or any other diagnostic information, it should return a tuple with the status and a list of diagnostics.

Callback implementation for Mix.Task.Compiler.run/1.

© 2012 Plataformatec
Licensed under the Apache License, Version 2.0.
https://hexdocs.pm/mix/1.6.6/Mix.Tasks.Compile.html