Custom Mix Tasks
mix test is a custom task, one that the Elixir team has written for us. mix is a tool that’s built in Elixir, and it’s an open one. From the beginning, the Elixir team concentrated on tools that the earliest developers could use to build a growing community library. We can write our own tasks as easily as we write any Elixir function. Let’s build a trivial remind task to help us remember how to do some simple tasks.
As you might expect, we’re going to create a new file. Because it’s part of our application, we’ll put it in the lib directory. We’ll create one subdirectory called mix within lib, and another subdirectory called tasks within mix. Then, we’ll create a new task called remind to hold all of the details about running ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access