Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/mix/lib/mix.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ defmodule Mix do
build tool for Clojure and was written by one of its contributors.

This module works as a facade for accessing the most common functionality
in Elixir, as the shell and the current project configuration.
in Elixir, such as the shell and the current project configuration.

For getting started with Elixir, checkout out the guide available in
For getting started with Elixir, checkout out the guide available on
[Elixir's website](http://elixir-lang.org).
"""

Expand Down Expand Up @@ -37,7 +37,7 @@ defmodule Mix do

@doc """
Changes the current mix env. Project configuration loaded
per environment is not going to be reloaded.
per environment will not be reloaded.
"""
def env(env) when is_atom(env) do
Mix.Server.cast({ :env, env })
Expand All @@ -52,7 +52,7 @@ defmodule Mix do
end

@doc """
Starts mix and loads the project and dependencies into
Starts mix and loads the project and dependencies in
one step. Useful when invoking mix from an external tool.
"""
def loadpaths do
Expand All @@ -64,8 +64,8 @@ defmodule Mix do
The shell is a wrapper for doing IO.

It contains conveniences for asking the user information,
printing status and so forth. The fact it is also swappable
allow developers to use a test shell, that simply sends the
printing status and so forth. It is also swappable,
allowing developers to use a test shell that simply sends the
messages to the current process.
"""
def shell do
Expand All @@ -81,9 +81,9 @@ defmodule Mix do

@doc """
Retrieves the current project configuration. If there
isn't a project defined, this function will simply
is not a project defined, this function will
return an empty keyword list. This allows many mix
tasks to work without a need for an underlying project.
tasks to work without the need for an underlying project.
"""
def project do
Mix.Project.config
Expand Down
4 changes: 2 additions & 2 deletions lib/mix/lib/mix/archive.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ defmodule Mix.Archive do
An archive is a zip file containing the app and beam files.
A valid archive must be named with the name of the application and
it should contain the relative paths beginning with the application
name, e.g. root of zip file should be `my_app/ebin/Elixir.My.App.beam`.
name, e.g. the root of the zip file should be `my_app/ebin/Elixir.My.App.beam`.
"""

@doc """
Returns the archive name based on the app and version.
Returns the archive name based on `app` and version.
"""
def name(app, nil), do: "#{app}.ez"
def name(app, vsn), do: "#{app}-#{vsn}.ez"
Expand Down
64 changes: 32 additions & 32 deletions lib/mix/lib/mix/deps.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ defrecord Mix.Dep, [ scm: nil, app: nil, requirement: nil, status: nil, opts: ni
deps: [], source: nil, manager: nil, from: nil ] do
@moduledoc """
This is a record that keeps information about your project
dependencies. It keeps:

* scm - a module representing the source code management tool (SCM) operations;
* app - the app name as an atom;
* requirement - a binary or regex with the dep's requirement
* status - the current status of dependency, check `Mix.Deps.format_status/1` for more info;
* opts - the options given by the developer
* deps - dependencies of this dependency
* source - any possible configuration associated with the manager field,
rebar.config for rebar or the Mix.Project for Mix
* manager - the project management, possible values: :rebar | :mix | :make | nil
* from - path to file where dependency was defined
dependencies. It contains:

* `scm` - a module representing the source code management tool (SCM) operations;
* `app` - the application name as an atom;
* `requirement` - a binary or regex with the dependency's requirement
* `status` - the current status of the dependency, check `Mix.Deps.format_status/1` for more info;
* `opts` - the options given by the developer
* `deps` - dependencies of this dependency
* `source` - any possible configuration associated with the `manager` field,
`rebar.config` for rebar or the `Mix.Project` for Mix
* `manager` - the project management, possible values: `:rebar` | `:mix` | `:make` | `nil`
* `from` - path to the file where the dependency was defined
"""
end

Expand All @@ -23,20 +23,20 @@ defmodule Mix.Deps do
"""

@doc """
Returns all dependencies recursively as `Mix.Dep` record.
Return all dependencies recursively as a `Mix.Dep` record.

## Exceptions

This function raises an exception in case the developer
provides a dependency in the wrong format.
This function raises an exception if the provided
dependency is in the wrong format.
"""
def all do
{ deps, _ } = Mix.Deps.Converger.all(nil, fn(dep, acc) -> { dep, acc } end)
deps
end

@doc """
Returns all dependencies but with a custom callback and
Return all dependencies, but with a custom callback and
accumulator.
"""
def all(acc, callback) do
Expand All @@ -45,12 +45,12 @@ defmodule Mix.Deps do
end

@doc """
Returns all direct child dependencies.
Return all direct child dependencies.
"""
defdelegate children(), to: Mix.Deps.Retriever

@doc """
Returns all dependencies depending on given dependencies.
Return all dependencies depending on the given dependencies.
"""
def depending(deps, all_deps // all)

Expand All @@ -69,7 +69,7 @@ defmodule Mix.Deps do
end

@doc """
Receives a list of deps names and returns deps records.
Receives a list of dependency names and returns dependency records.
Logs a message if the dependency could not be found.
"""
def by_name(given, all_deps // all) do
Expand All @@ -93,9 +93,9 @@ defmodule Mix.Deps do
end

@doc """
Runs the given `fun` inside the given dependency project by
Run the given `fun` inside the given dependency project by
changing the current working directory and loading the given
project into the project stack.
project onto the project stack.
"""
def in_dependency(dep, post_config // [], fun)

Expand Down Expand Up @@ -123,13 +123,13 @@ defmodule Mix.Deps do
end

@doc """
Formats the status of a dependency.
Format the status of a dependency.
"""
def format_status(Mix.Dep[status: { :ok, _vsn }]),
do: "ok"

def format_status(Mix.Dep[status: { :noappfile, path }]),
do: "could not find app file at #{Mix.Utils.relative_to_cwd(path)}"
do: "could not find an app file at #{Mix.Utils.relative_to_cwd(path)}"

def format_status(Mix.Dep[status: { :invalidapp, path }]),
do: "the app file at #{Mix.Utils.relative_to_cwd(path)} is invalid"
Expand Down Expand Up @@ -160,7 +160,7 @@ defmodule Mix.Deps do
do: "the dependency is not available, run `mix deps.get`"

@doc """
Checks the lock for the given dependency and update its status accordingly.
Check the lock for the given dependency and update its status accordingly.
"""
def check_lock(Mix.Dep[scm: scm, app: app, opts: opts] = dep, lock) do
if available?(dep) do
Expand All @@ -179,7 +179,7 @@ defmodule Mix.Deps do
end

@doc """
Updates the dependency inside the given project.
Update the dependency inside the given project.
"""
defdelegate update(dep), to: Mix.Deps.Retriever

Expand All @@ -205,7 +205,7 @@ defmodule Mix.Deps do
end

@doc """
Check if a dependency is out of date or not, considering its
Check if a dependency is out of date, considering its
lock status. Therefore, be sure to call `check_lock` before
invoking this function.
"""
Expand All @@ -214,7 +214,7 @@ defmodule Mix.Deps do
def out_of_date?(dep), do: not available?(dep)

@doc """
Format the dependency for printing.
Format a dependency for printing.
"""
def format_dep(Mix.Dep[scm: scm, app: app, status: status, opts: opts]) do
version =
Expand All @@ -227,7 +227,7 @@ defmodule Mix.Deps do
end

@doc """
Returns all compile paths for the dependency.
Return all compile paths for the dependency.
"""
def compile_paths(Mix.Dep[app: app, opts: opts, manager: manager]) do
if manager == :mix do
Expand All @@ -240,7 +240,7 @@ defmodule Mix.Deps do
end

@doc """
Returns all load paths for the dependency.
Return all load paths for the dependency.
"""
def load_paths(Mix.Dep[manager: :mix, app: app, opts: opts]) do
paths = Mix.Project.in_project app, opts[:dest], fn _ ->
Expand All @@ -267,21 +267,21 @@ defmodule Mix.Deps do
end

@doc """
Returns true if dependency is a mix project.
Return `true` if dependency is a mix project.
"""
def mix?(Mix.Dep[manager: manager]) do
manager == :mix
end

@doc """
Returns true if dependency is a rebar project.
Return `true` if dependency is a rebar project.
"""
def rebar?(Mix.Dep[manager: manager]) do
manager == :rebar
end

@doc """
Returns true if dependency is a make project.
Return `true` if dependency is a make project.
"""
def make?(Mix.Dep[manager: manager]) do
manager == :make
Expand Down
6 changes: 3 additions & 3 deletions lib/mix/lib/mix/tasks/deps.check.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ defmodule Mix.Tasks.Deps.Check do
import Mix.Deps, only: [all: 0, format_dep: 1, format_status: 1, check_lock: 2, out_of_date?: 1]

@hidden true
@shortdoc "Check if all dependencies are ok"
@shortdoc "Check if all dependencies are valid"
@recursive :both

@moduledoc """
Checks if all dependencies are valid and if not, abort.
Prints the invalid dependencies status before aborting.
Prints the invalid dependencies' status before aborting.

This task is not shown in `mix help` but it is part
of mix public API and can be depended on.
of the `mix` public API and can be depended on.
"""
def run(_) do
lock = Mix.Deps.Lock.read
Expand Down
6 changes: 3 additions & 3 deletions lib/mix/lib/mix/tasks/deps.clean.ex
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
defmodule Mix.Tasks.Deps.Clean do
use Mix.Task

@shortdoc "Remove dependencies files"
@shortdoc "Remove dependencies' files"
@recursive :both

@moduledoc """
Clean dependencies.

By default, cleans all dependencies. A list of deps can
By default, cleans all dependencies. A list of dependencies can
be given to clean specific ones. Clean does not unlock
the repositories, unless --unlock is given.
the repositories, unless `--unlock` is given.
"""

import Mix.Deps, only: [all: 0, by_name: 1, format_dep: 1]
Expand Down
12 changes: 6 additions & 6 deletions lib/mix/lib/mix/tasks/deps.compile.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ defmodule Mix.Tasks.Deps.Compile do
@moduledoc """
Compile dependencies.

By default, compile all dependencies. A list of deps can
be given to force the compilation of specific deps.
By default, compile all dependencies. A list of dependencies can
be given to force the compilation of specific dependencies.

By default, it tries to detect if the project contains one of
By default, attempt to detect if the project contains one of
the following files:

* `mix.exs` - if so, invokes `mix compile`
Expand Down Expand Up @@ -97,7 +97,7 @@ defmodule Mix.Tasks.Deps.Compile do
catch
kind, reason ->
Mix.shell.error "could not compile dependency #{app}, mix compile failed. " <>
"In case you want to recompile this dependency, please run: mix deps.compile #{app}"
"If you want to recompile this dependency, please run: mix deps.compile #{app}"
:erlang.raise(kind, reason, System.stacktrace)
after
Mix.env(old_env)
Expand Down Expand Up @@ -129,7 +129,7 @@ defmodule Mix.Tasks.Deps.Compile do
defp do_command(app, command, extra // "") do
if Mix.shell.cmd("#{command} #{extra}") != 0 do
raise Mix.Error, message: "could not compile dependency #{app}, #{command} command failed. " <>
"In case you want to recompile this dependency, please run: mix deps.compile #{app}"
"If you want to recompile this dependency, please run: mix deps.compile #{app}"
end
end

Expand All @@ -141,7 +141,7 @@ defmodule Mix.Tasks.Deps.Compile do
Mix.shell.info("#{app}: #{command}")
if Mix.shell.cmd(command) != 0 do
raise Mix.Error, message: "could not compile dependency #{app}, custom #{command} command failed. " <>
"In case you want to recompile this dependency, please run: mix deps.compile #{app}"
"If you want to recompile this dependency, please run: mix deps.compile #{app}"
end
end
end
2 changes: 1 addition & 1 deletion lib/mix/lib/mix/tasks/deps.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Mix.Tasks.Deps do

@moduledoc """
List all dependencies and their status.
The output is given as follow:
The output is given as follows:

* APP [VERSION] SCM: LOCATION
[locked at REF]
Expand Down
4 changes: 2 additions & 2 deletions lib/mix/lib/mix/tasks/deps.loadpaths.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ defmodule Mix.Tasks.Deps.Loadpaths do
import Mix.Deps, only: [all: 0, load_paths: 1, ok?: 1]

@hidden true
@shortdoc "Load all dependencies paths"
@shortdoc "Load all dependencies' paths"
@recursive :both

@moduledoc """
Loads all dependencies. This is invoked directly
by "loadpaths" when the CLI boots.
by `loadpaths` when the CLI boots.
"""
def run(args) do
{ opts, _ } = OptionParser.parse(args)
Expand Down
2 changes: 1 addition & 1 deletion lib/mix/lib/mix/tasks/deps.update.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Mix.Tasks.Deps.Update do
@moduledoc """
Update dependencies.

By default, updates all dependencies. A list of deps can
By default, updates all dependencies. A list of dependencies can
be given to update specific ones. Recompiles the given
projects after updating.

Expand Down
4 changes: 2 additions & 2 deletions lib/mix/test/mix/tasks/deps_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ defmodule Mix.Tasks.DepsTest do
assert_received { :mix_shell, :info, ["* invalidapp [path: \"deps/invalidapp\"]"] }
assert_received { :mix_shell, :info, [" the app file at deps/invalidapp/ebin/invalidapp.app is invalid"] }
assert_received { :mix_shell, :info, ["* noappfile [path: \"deps/noappfile\"]"] }
assert_received { :mix_shell, :info, [" could not find app file at deps/noappfile/ebin/noappfile.app"] }
assert_received { :mix_shell, :info, [" could not find an app file at deps/noappfile/ebin/noappfile.app"] }
assert_received { :mix_shell, :info, ["* uncloned [git: \"https://github.com/elixir-lang/uncloned.git\"]"] }
assert_received { :mix_shell, :info, [" the dependency is not available, run `mix deps.get`"] }
end
Expand Down Expand Up @@ -131,7 +131,7 @@ defmodule Mix.Tasks.DepsTest do
assert_received { :mix_shell, :error, ["* invalidapp [path: \"deps/invalidapp\"]"] }
assert_received { :mix_shell, :error, [" the app file at deps/invalidapp/ebin/invalidapp.app is invalid"] }
assert_received { :mix_shell, :error, ["* noappfile [path: \"deps/noappfile\"]"] }
assert_received { :mix_shell, :error, [" could not find app file at deps/noappfile/ebin/noappfile.app"] }
assert_received { :mix_shell, :error, [" could not find an app file at deps/noappfile/ebin/noappfile.app"] }
assert_received { :mix_shell, :error, ["* uncloned [git: \"https://github.com/elixir-lang/uncloned.git\"]"] }
assert_received { :mix_shell, :error, [" the dependency is not available, run `mix deps.get`"] }
end
Expand Down