Mix v1.7.4 Mix.Task.Compiler behaviour View Source
This module defines the behaviour for a Mix task that does compilation.
A Mix compiler task can be defined by simply using
in a module whose name starts with
Mix.Tasks.Compile. and defining
defmodule Mix.Tasks.Compile.MyLanguage do use Mix.Task.Compiler def run(_args) do :ok end end
run/1 function returns an atom indicating the status of the
compilation, and optionally can also return a list of “diagnostics”
such as warnings or compilation errors. Doing this enables code
editors to display issues inline without having to analyze the
If the compiler uses manifest files to track stale sources, it should
manifests/0, and if it writes any output to disk it should
A compiler supports the same attributes for configuration and
documentation as a regular Mix task. See
Mix.Task for more information.
Link to this section Summary
Removes build artifacts and manifests
Lists manifest files for the compiler
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
Link to this section Callbacks
Removes build artifacts and manifests.
Lists manifest files for the compiler.
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.