Mix
Mix
Mix is a build tool that provides tasks for creating, compiling, and testing Elixir projects, managing its dependencies, and more.
Mix.Project
The foundation of Mix is a project. A project can be defined by using Mix.Project
in a module, usually placed in a file named mix.exs
:
defmodule MyApp.Mixfile do
use Mix.Project
def project do
[app: :my_app,
version: "1.0.0"]
end
end
The project/0
function is where the project information is defined and it allows developers to configure many tasks.
After the project above is defined, there are many tasks one can run directly from the command line:
-
mix compile
- compiles the current