1MIX(1) BSD General Commands Manual MIX(1)
2
4 mix — The software project management tool
5
7 mix [TASK] [project_name]
8 elixir [OPTIONS] -S mix [TASK] [project_name]
9
11 mix is intended for both organizing code into projects and their mainte‐
12 nance. For the latter the tool offers some advanced features like depen‐
13 dency management, packaging, preparing documentation, testing and so on.
14
15 Have a look at the SYNOPSIS section and the second way of running mix it
16 offers. The point is that the tool is none other than the Elixir script,
17 therefore it can be invoked via elixir(1) in the same way as any other
18 script. It's useful when you want to run mix with particular options.
19
21 All the mix functionality is represented by a set of tasks. A task is a
22 piece of code written in Elixir and intended for solving a particular
23 problem. Like programs, many tasks accept input parameters and/or support
24 options which slightly modify their behaviour, but others do not. There
25 are two types of tasks: those that are available after installation this
26 or that archive (local tasks) and those that are offered by mix (built-in
27 tasks). The run task will be executed by default if none other has been
28 specified.
29
30 In spite of the fact that the greater part of mix is tasks, the man page
31 doesn't contain the help information related to each of them because mix
32 is self-descriptive. Thus, using the help task, you can get both the full
33 list of local/built-in tasks and the information related to a particular
34 task.
35
36 An archive, in terms of Erlang/OTP, is the ZIP file with the .ez exten‐
37 sion which contains a precompiled OTP application with all its dependen‐
38 cies[1].
39
40 An application is an entity that helps to combine sets of components into
41 a single unit to simplify their reusing in other systems[2].
42
44 MIX_ARCHIVES
45 Allows specifying the directory into which the archives should be
46 installed (see mix help archive.install). The ~/.mix/archives
47 directory is used for this purpose by default.
48
49 MIX_DEBUG
50 When set, outputs debug information about each task before run‐
51 ning it.
52
53 MIX_ENV
54 Allows specifying which environment should be used. The dev envi‐
55 ronment is used by default if none other has been specified.
56
57 Sometimes you have to use a particular set of configuration pa‐
58 rameter values or perform particular steps when you compile or
59 run a project (or in some other cases). The mix environments al‐
60 low grouping values of configuration parameters and steps to
61 switch between them by specifying the necessary environment via
62 MIX_ENV.
63
64 MIX_TARGET
65 Allows specifying which target should be used. The host target is
66 used by default if none other has been specified.
67
68 MIX_EXS
69 Allows changing the full path to the mix.exs file (see FILES
70 section). The most obvious use case is to have more than one
71 copy of mix.exs in a project, but it's worth noting that MIX_EXS
72 should be used only if the mix environments (see above) are not
73 enough to solve the problem.
74
75 MIX_HOME
76 path to Mix's home directory, stores configuration files and
77 scripts used by Mix
78
79 MIX_INSTALL_DIR
80 Specifies directory where Mix.install/2 keeps installs cache
81
82 MIX_PATH
83 Allows expanding the code path. If the MIX_PATH environment vari‐
84 able has a value which consists of multiple paths, they must be
85 colon-separated (for Unix-like operating systems) or semicolon-
86 separated (for Windows).
87
88 As mentioned above, there are two types of tasks: local and
89 built-in. These tasks are always visible for mix because the di‐
90 rectories, in which they are located, are a part of code path. If
91 a task belongs to neither the one type nor the other, MIX_PATH
92 helps you say to mix where it should search the task.
93
94 MIX_QUIET
95 When set, does not print information messages to the terminal.
96
98 mix.exs
99 Contains the most significant information related to the project,
100 such as its name, version, list of dependencies and so on. As a
101 rule, the file is named mix.exs and located at the top of the
102 project's source tree, but you can change the full path to it us‐
103 ing the MIX_EXS environment variable (see the ENVIRONMENT
104 section).
105
106 mix.lock
107 Allows locking down the project dependencies with a proper ver‐
108 sion range before performing any updates. It is useful when you
109 know that your project is incompatible with newer versions of
110 certain dependencies. The file is located at the top of the
111 project's source tree as well as mix.exs (see above).
112
114 [1] https://erlang.org/doc/man/code.html#id103620
115
116 [2] https://erlang.org/doc/design_principles/applications.html
117
119 elixir(1), elixirc(1), iex(1)
120
122 Elixir is maintained by the Elixir Core Team.
123
124 This manual page was contributed by Evgeny Golyshev.
125
126 Copyright (c) 2012 Plataformatec.
127
129 Main website: https://elixir-lang.org
130
131 Documentation: https://elixir-lang.org/docs.html
132
133BSD May 27, 2015 BSD