liveBook · Manning

Mix

As explained in Elixir in Action, Third Edition

Mix is Elixir's build tool for creating, compiling, testing, and managing Elixir projects and their dependencies.

Mix is Elixir’s project tool for creating, compiling, testing, and running multifile applications while managing dependencies and custom project tasks. It replaces ad hoc file handling with a small, conventional project structure. section 1.2.3 section 7.1

A practical Mix workflow includes:

  • Create a project with mix new todo. section 7.1
  • Compile it with mix compile and run its tests with mix test. section 7.1
  • Place .ex files under lib, including nested folders, for automatic inclusion in the next build. section 7.1
  • Use iex -S mix to compile the project and open an interactive shell with its modules available. section 7.1
  • Run mix help or mix help command to inspect available tasks and task-specific guidance. section 7.1

Start a project

Run mix new todo, enter the todo directory, and use mix compile or mix test. For interactive experimentation, start iex -S mix and call the project’s modules from the shell. section 7.1

How Elixir in Action, Third Edition covers it

How deep it goes
Demonstrates project creation, compilation, testing, source layout, interactive shells, and help while deferring detailed Mix coverage.
Examples
Uses the todo project, mix new todo, mix compile, mix test, and iex -S mix as concrete operational examples.
What it assumes
Assumes basic Elixir code and command-line use while introducing project layout and essential Mix commands.
What you can do after
Operate/configure projects by creating them, compiling code, running tests, launching an interactive shell, and discovering tasks.
How it connects
Connects project structure with dependencies, compilation, testing, custom tasks, Elixir modules, and the iex shell.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elixir in Action, Third Edition. The section links point to the parts of the book it draws on.