forked from elixir-lang/elixir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmix.1
147 lines (147 loc) · 5.01 KB
/
mix.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
.Dd May 27, 2015
.Dt MIX 1
.Os
.Sh NAME
.Nm mix
.Nd The software project management tool
.Sh SYNOPSIS
.Nm
.Op Ar TASK
.Op Ar project_name
.Nm elixir
.Op Ar OPTIONS
.Fl S Nm
.Op Ar TASK
.Op Ar project_name
.Sh DESCRIPTION
.Nm
is intended for both organizing code into projects and their maintenance. For the latter the tool offers some advanced features like dependency management, packaging, preparing documentation, testing and so on.
.Pp
Have a look at the
.Sy SYNOPSIS
section and the second way of running
.Nm
it offers. The point is that the tool is none other than the Elixir script, therefore it can be invoked via
.Xr elixir 1
in the same way as any other script. It's useful when you want to run
.Nm
with particular options.
.Sh DEFINITIONS
All the
.Nm
functionality is represented by a set of tasks. A
.Em task
is a piece of code written in Elixir and intended for solving a particular problem. Like programs, many tasks accept input parameters and/or support options which slightly modify their behaviour, but others do not. There are two types of tasks: those that are available after installation this or that archive
.Pq local tasks
and those that are offered by
.Nm
.Pq built-in tasks .
The
.Sy run
task will be executed by default if none other has been specified.
.Pp
In spite of the fact that the greater part of
.Nm
is tasks, the man page doesn't contain the help information related to each of them because
.Nm
is self-descriptive. Thus, using the
.Sy help
task, you can get both the full list of local/built-in tasks and the information related to a particular task.
.Pp
An
.Em archive ,
in terms of Erlang, is the ZIP file with the
.Em .ez
extension which contains a precompiled Erlang application with all its dependencies[1].
.Pp
An
.Em application
is an entity that helps to combine sets of components into a single unit to simplify their reusing in other systems[2].
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Ev MIX_ARCHIVES
Allows specifying the directory into which the archives should be installed
.Pq see Sy mix help archive.install .
The
.Em ~/.mix/archives
directory is used for this purpose by default.
.It Ev MIX_DEBUG
When set, outputs debug information about each task before running it.
.It Ev MIX_ENV
Allows specifying which environment should be used. The
.Em dev
environment is used by default if none other has been specified.
.Pp
Sometimes you have to use a particular set of configuration parameter values or perform particular steps when you compile or run a project
.Pq or in some other cases .
The
.Nm
environments allow grouping values of configuration parameters and steps to switch between them by specifying the necessary environment via MIX_ENV.
.It Ev MIX_EXS
Allows changing the full path to the
.Em mix.exs
file
.Pq see Sy FILES No section .
The most obvious use case is to have more than one copy of
.Em mix.exs
in a project, but it's worth noting that MIX_EXS should be used only if the
.Nm
environments
.Pq see above
are not enough to solve the problem.
.It Ev MIX_HOME
Stores configuration files and scripts shared by multiple
.Nm
implementations.
.Pp
See the
.Sy Mix.Utils.mix_home/0
function.
.It Ev MIX_PATH
Allows expanding the code path. If the MIX_PATH environment variable has a value which consists of multiple paths, they must be colon-separated
.Pq for Unix-like operating systems
or semicolon-separated
.Pq for Windows .
.Pp
As has already been mentioned above, there are two types of tasks: local and built-in. These tasks are always visible for
.Nm
because the directories, in which they are located, are a part of code path. If a task belongs to neither the one type nor the other, MIX_PATH helps you say to
.Nm
where it should search the task.
.Pp
Use the
.Sy :code.get_path/0
function to get the list of paths which are a part of the code path by default and the
.Sy Mix.Utils.mix_paths/0
function to get the list of paths specified in the MIX_PATH value.
.It Ev MIX_QUIET
When set, does not print information messages to the terminal.
.El
.Sh FILES
.Bl -tag -width Ds
.It mix.exs
Contains the most significant information related to the project, such as its name, version, list of dependencies and so on. As a rule, the file is named
.Em mix.exs
and located at the top of the project's source tree, but you can change the full path to it using the MIX_EXS environment variable
.Pq see the Sy ENVIRONMENT No section .
.It mix.lock
Allows locking down the project dependencies with a proper version range before performing any updates. It is useful when you know that your project is incompatible with newer versions of certain dependencies. The file is located at the top of the project's source tree as well as
.Em mix.exs
.Pq see above .
.El
.Sh REFERENCES
.Bl -tag -width Ds
.It [1] http://www.erlang.org/doc/man/code.html#id103620
.It [2] http://www.erlang.org/doc/design_principles/applications.html
.El
.Sh SEE ALSO
.Xr elixir 1 ,
.Xr elixirc 1 ,
.Xr iex 1
.Sh AUTHOR
This manual page contributed by Evgeny Golyshev.
.Sh INTERNET RESOURCES
.Bl -tag -width Ds
.It Main website: http://elixir-lang.org
.It Documentation: http://elixir-lang.org/docs.html
.El