Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-release > by-pkgid > 016232f1d9a3f7bee85855d35a2bca58 > files > 201

elixir-doc-1.7.2-1.mga7.noarch.rpm

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="ExDoc v0.19.1">
    <title>Mix.Project – Mix v1.7.2</title>
    <link rel="stylesheet" href="dist/app-240d7fc7e5.css" />
      <link rel="canonical" href="https://hexdocs.pm/mix/v1.7/Mix.Project.html" />
    <script src="dist/sidebar_items-0c0044e6e4.js"></script>
    
  </head>
  <body data-type="modules">
    <script>try { if(localStorage.getItem('night-mode')) document.body.className += ' night-mode'; } catch (e) { }</script>
    <div class="main">
<button class="sidebar-button sidebar-toggle">
  <span class="icon-menu" aria-hidden="true"></span>
  <span class="sr-only">Toggle Sidebar</span>
</button>
<button class="sidebar-button night-mode-toggle">
  <span class="icon-theme" aria-hidden="true"></span>
  <span class="sr-only">Toggle Theme</span>
</button>
<section class="sidebar">

  <a href="http://elixir-lang.org/docs.html" class="sidebar-projectLink">
    <div class="sidebar-projectDetails">
      <h1 class="sidebar-projectName">
Mix      </h1>
      <h2 class="sidebar-projectVersion">
        v1.7.2
      </h2>
    </div>
      <img src="assets/logo.png" alt="Mix" class="sidebar-projectImage">
  </a>

  <form class="sidebar-search" action="search.html">
    <button type="submit" class="search-button">
      <span class="icon-search" aria-hidden="true"></span>
    </button>
    <input name="q" type="text" id="search-list" class="search-input" placeholder="Search" aria-label="Search" autocomplete="off" />
  </form>

  <ul class="sidebar-listNav">
    <li><a id="extras-list" href="#full-list">Pages</a></li>

      <li><a id="modules-list" href="#full-list">Modules</a></li>

      <li><a id="exceptions-list" href="#full-list">Exceptions</a></li>

      <li><a id="tasks-list" href="#full-list">Mix Tasks</a></li>
  </ul>
  <div class="gradient"></div>
  <ul id="full-list" class="sidebar-fullList"></ul>
</section>

<section class="content">
  <div class="content-outer">
    <div id="content" class="content-inner">


      <h1>
        <small class="visible-xs">Mix v1.7.2</small>
Mix.Project        
          <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L1" title="View Source" class="view-source" rel="help">
            <span class="icon-code" aria-hidden="true"></span>
            <span class="sr-only">View Source</span>
          </a>
      </h1>


        <section id="moduledoc">
<p>Defines and manipulates Mix projects.</p>
<p>A Mix project is defined by calling <code class="inline">use Mix.Project</code> in a module, usually
placed in <code class="inline">mix.exs</code>:</p>
<pre><code class="nohighlight makeup elixir"><span class="kd">defmodule</span><span class="w"> </span><span class="nc">MyApp.MixProject</span><span class="w"> </span><span class="k" data-group-id="8762042191-1">do</span><span class="w">
  </span><span class="kn">use</span><span class="w"> </span><span class="nc">Mix.Project</span><span class="w">

  </span><span class="kd">def</span><span class="w"> </span><span class="nf">project</span><span class="w"> </span><span class="k" data-group-id="8762042191-2">do</span><span class="w">
    </span><span class="p" data-group-id="8762042191-3">[</span><span class="w">
      </span><span class="ss">app</span><span class="p">:</span><span class="w"> </span><span class="ss">:my_app</span><span class="p">,</span><span class="w">
      </span><span class="ss">version</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;1.0.0&quot;</span><span class="w">
    </span><span class="p" data-group-id="8762042191-3">]</span><span class="w">
  </span><span class="k" data-group-id="8762042191-2">end</span><span class="w">
</span><span class="k" data-group-id="8762042191-1">end</span></code></pre>
<h2 id="module-configuration" class="section-heading">
  <a href="#module-configuration" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
  Configuration
</h2>

<p>In order to configure Mix, the module that <code class="inline">use</code>s <a href="Mix.Project.html#content"><code class="inline">Mix.Project</code></a> should export
a <code class="inline">project/0</code> function that returns a keyword list representing configuration
for the project.</p>
<p>This configuration can be read using <a href="Mix.Project.html#config/0"><code class="inline">Mix.Project.config/0</code></a>. Note that
<a href="#config/0"><code class="inline">config/0</code></a> won’t fail if a project is not defined; this allows many Mix tasks
to work without a project.</p>
<p>If a task requires a project to be defined or needs to access a
special function within the project, the task can call <a href="Mix.Project.html#get!/0"><code class="inline">Mix.Project.get!/0</code></a>
which fails with <a href="Mix.NoProjectError.html"><code class="inline">Mix.NoProjectError</code></a> in the case a project is not
defined.</p>
<p>There isn’t a comprehensive list of all the options that can be returned by
<code class="inline">project/0</code> since many Mix tasks define their own options that they read from
this configuration. For example, look at the “Configuration” section in the
documentation for the <a href="Mix.Tasks.Compile.html"><code class="inline">Mix.Tasks.Compile</code></a> task.</p>
<p>These are a few options that are not used by just one Mix task (and will thus
be documented here):</p>
<ul>
<li><p><code class="inline">:build_per_environment</code> - if <code class="inline">true</code>, builds will be <em>per-environment</em>. If
<code class="inline">false</code>, builds will go in <code class="inline">_build/shared</code> regardless of the Mix
environment. Defaults to <code class="inline">true</code>.</p>
</li>
<li><p><code class="inline">:aliases</code> - a list of task aliases. For more information, check out the
“Aliases” section in the documentation for the <a href="Mix.html"><code class="inline">Mix</code></a> module. Defaults to
<code class="inline">[]</code>.</p>
</li>
<li><p><code class="inline">:config_path</code> - a string representing the path of the main config
file. See <a href="#config_files/0"><code class="inline">config_files/0</code></a> for more information. Defaults to
<code class="inline">&quot;config/config.exs&quot;</code>.</p>
</li>
<li><p><code class="inline">:default_task</code> - a string representing the default task to be run by
<code class="inline">mix</code> when no task is specified. Defaults to <code class="inline">&quot;run&quot;</code>.</p>
</li>
<li><p><code class="inline">:deps</code> - a list of dependencies of this project. Refer to the
documentation for the <a href="Mix.Tasks.Deps.html"><code class="inline">Mix.Tasks.Deps</code></a> task for more information. Defaults
to <code class="inline">[]</code>.</p>
</li>
<li><p><code class="inline">:deps_path</code> - directory where dependencies are stored. Also see
<a href="#deps_path/1"><code class="inline">deps_path/1</code></a>. Defaults to <code class="inline">&quot;deps&quot;</code>.</p>
</li>
<li><p><code class="inline">:lockfile</code> - the name of the lockfile used by the <code class="inline">mix deps.*</code> family of
tasks. Defaults to <code class="inline">&quot;mix.lock&quot;</code>.</p>
</li>
<li><p><code class="inline">:preferred_cli_env</code> - a keyword list of <code class="inline">{task, env}</code> tuples where <code class="inline">task</code>
is the task name as an atom (for example, <code class="inline">:&quot;deps.get&quot;</code>) and <code class="inline">env</code> is the
preferred environment (for example, <code class="inline">:test</code>). This option overrides what
specified by the tasks with the <code class="inline">@preferred_cli_env</code> attribute (see the
docs for <a href="Mix.Task.html"><code class="inline">Mix.Task</code></a>). Defaults to <code class="inline">[]</code>.</p>
</li>
</ul>
<p>For more options, keep an eye on the documentation for single Mix tasks; good
examples are the <a href="Mix.Tasks.Compile.html"><code class="inline">Mix.Tasks.Compile</code></a> task and all the specific compiler tasks
(such as <a href="Mix.Tasks.Compile.Elixir.html"><code class="inline">Mix.Tasks.Compile.Elixir</code></a> or <a href="Mix.Tasks.Compile.Erlang.html"><code class="inline">Mix.Tasks.Compile.Erlang</code></a>).</p>
<p>Note that sometimes the same configuration option is mentioned in the
documentation for different tasks; this is just because it’s common for many
tasks to read and use the same configuration option (for example,
<code class="inline">:erlc_paths</code> is used by <code class="inline">mix compile.erlang</code>, <code class="inline">mix compile.yecc</code>, and other
tasks).</p>
<h2 id="module-erlang-projects" class="section-heading">
  <a href="#module-erlang-projects" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
  Erlang projects
</h2>

<p>Mix can be used to manage Erlang projects that don’t have any Elixir code. To
ensure Mix tasks work correctly for an Erlang project, <code class="inline">language: :erlang</code> has
to be part of the configuration returned by <code class="inline">project/0</code>. This setting also
makes sure Elixir is not added as a dependency to the generated <code class="inline">.app</code> file or
to the escript generated with <code class="inline">mix escript.build</code>, and so on.</p>
        </section>

        <section id="summary" class="details-list">
          <h1 class="section-heading">
            <a class="hover-link" href="#summary">
              <span class="icon-link" aria-hidden="true"></span>
              <span class="sr-only">Link to this section</span>
            </a>
            Summary
          </h1>
          
  <div class="summary-functions summary">
    <h2>
      <a href="#functions">Functions</a>
    </h2>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#app_path/1">app_path(config \\ config())</a>
  </div>
    <div class="summary-synopsis"><p>Returns the application path inside the build</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#apps_paths/1">apps_paths(config \\ config())</a>
  </div>
    <div class="summary-synopsis"><p>Returns a map with the umbrella child applications paths</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#build_path/1">build_path(config \\ config())</a>
  </div>
    <div class="summary-synopsis"><p>Returns the build path for the given project</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#build_structure/2">build_structure(config \\ config(), opts \\ [])</a>
  </div>
    <div class="summary-synopsis"><p>Builds the project structure for the given application</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#clear_deps_cache/0">clear_deps_cache()</a>
  </div>
    <div class="summary-synopsis"><p>Clears the dependency for the current environment</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#compile/2">compile(args, config \\ [])</a>
  </div>
    <div class="summary-synopsis"><p>Compiles the given project</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#compile_path/1">compile_path(config \\ config())</a>
  </div>
    <div class="summary-synopsis"><p>Returns the paths the given project compiles to</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#config/0">config()</a>
  </div>
    <div class="summary-synopsis"><p>Returns the project configuration</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#config_files/0">config_files()</a>
  </div>
    <div class="summary-synopsis"><p>Returns a list of project configuration files for this project</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#config_mtime/0">config_mtime()</a>
  </div>
    <div class="summary-synopsis"><p>Returns the latest modification time from config files</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#consolidation_path/1">consolidation_path(config \\ config())</a>
  </div>
    <div class="summary-synopsis"><p>Returns the path where protocol consolidations are stored</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#deps_path/1">deps_path(config \\ config())</a>
  </div>
    <div class="summary-synopsis"><p>Returns the path where dependencies are stored for the given project</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#deps_paths/0">deps_paths()</a>
  </div>
    <div class="summary-synopsis"><p>Returns the full path of all dependencies as a map</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#ensure_structure/2">ensure_structure(config \\ config(), opts \\ [])</a>
  </div>
    <div class="summary-synopsis"><p>Ensures the project structure for the given project exists</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#get!/0">get!()</a>
  </div>
    <div class="summary-synopsis"><p>Same as <a href="#get/0"><code class="inline">get/0</code></a>, but raises an exception if there is no current project</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#get/0">get()</a>
  </div>
    <div class="summary-synopsis"><p>Retrieves the current project if there is one</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#in_project/4">in_project(app, path, post_config \\ [], fun)</a>
  </div>
    <div class="summary-synopsis"><p>Runs the given <code class="inline">fun</code> inside the given project</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#load_paths/1">load_paths(config \\ config())</a>
  </div>
    <div class="summary-synopsis"><p>Returns all load paths for the given project</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#manifest_path/1">manifest_path(config \\ config())</a>
  </div>
    <div class="summary-synopsis"><p>Returns the path where manifests are stored</p>
</div>
</div>
<div class="summary-row">
  <div class="summary-signature">
    <a href="#umbrella?/1">umbrella?(config \\ config())</a>
  </div>
    <div class="summary-synopsis"><p>Returns <code class="inline">true</code> if <code class="inline">config</code> is the configuration for an umbrella project</p>
</div>
</div>
  </div>
          
        </section>



        <section id="functions" class="details-list">
          <h1 class="section-heading">
            <a class="hover-link" href="#functions">
              <span class="icon-link" aria-hidden="true"></span>
              <span class="sr-only">Link to this section</span>
            </a>
            Functions
          </h1>
<div class="detail" id="app_path/1">
  
    <span id="app_path/0"></span>
  <div class="detail-header">
    <a href="#app_path/1" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">app_path(config \\ config())</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L488" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>app_path(<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">keyword</a>()) :: <a href="https://hexdocs.pm/elixir/Path.html#t:t/0">Path.t</a>()</pre>
      </div>
  </div>
  <section class="docstring">
<p>Returns the application path inside the build.</p>
<p>The returned path will be expanded.</p>
<h2 id="app_path/1-examples" class="section-heading">
  <a href="#app_path/1-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
  Examples
</h2>

<pre><code class="nohighlight makeup elixir"><span class="nc">Mix.Project</span><span class="o">.</span><span class="n">app_path</span><span class="p" data-group-id="3313824060-1">(</span><span class="p" data-group-id="3313824060-1">)</span><span class="w">
</span><span class="c1">#=&gt; &quot;/path/to/project/_build/shared/lib/app&quot;</span></code></pre>
  </section>
</div>
<div class="detail" id="apps_paths/1">
  
    <span id="apps_paths/0"></span>
  <div class="detail-header">
    <a href="#apps_paths/1" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">apps_paths(config \\ config())</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L259" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
    
      <span class="note">(since 1.4.0)</span>
      </div>
  <section class="docstring">
<p>Returns a map with the umbrella child applications paths.</p>
<p>These paths are based on the <code class="inline">:apps_path</code> and <code class="inline">:apps</code> configurations.</p>
<p>If the given project configuration identifies an umbrella project, the return
value is a map of <code class="inline">app =&gt; path</code> where <code class="inline">app</code> is a child app of the umbrella and
<code class="inline">path</code> is its path relative to the root of the umbrella project.</p>
<p>If the given project configuration does not identify an umbrella project,
<code class="inline">nil</code> is returned.</p>
<h2 id="apps_paths/1-examples" class="section-heading">
  <a href="#apps_paths/1-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
  Examples
</h2>

<pre><code class="nohighlight makeup elixir"><span class="nc">Mix.Project</span><span class="o">.</span><span class="n">apps_paths</span><span class="p" data-group-id="4456854582-1">(</span><span class="p" data-group-id="4456854582-1">)</span><span class="w">
</span><span class="c1">#=&gt; %{my_app1: &quot;apps/my_app1&quot;, my_app2: &quot;apps/my_app2&quot;}</span></code></pre>
  </section>
</div>
<div class="detail" id="build_path/1">
  
    <span id="build_path/0"></span>
  <div class="detail-header">
    <a href="#build_path/1" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">build_path(config \\ config())</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L428" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>build_path(<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">keyword</a>()) :: <a href="https://hexdocs.pm/elixir/Path.html#t:t/0">Path.t</a>()</pre>
      </div>
  </div>
  <section class="docstring">
<p>Returns the build path for the given project.</p>
<p>If no configuration is given, the one for the current project is used.</p>
<p>The returned path will be expanded.</p>
<h2 id="build_path/1-examples" class="section-heading">
  <a href="#build_path/1-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
  Examples
</h2>

<pre><code class="nohighlight makeup elixir"><span class="nc">Mix.Project</span><span class="o">.</span><span class="n">build_path</span><span class="p" data-group-id="7231214393-1">(</span><span class="p" data-group-id="7231214393-1">)</span><span class="w">
</span><span class="c1">#=&gt; &quot;/path/to/project/_build/shared&quot;</span></code></pre>
<p>If <code class="inline">:build_per_environment</code> is set to <code class="inline">true</code>, it will create a new build per
environment:</p>
<pre><code class="nohighlight makeup elixir"><span class="nc">Mix</span><span class="o">.</span><span class="n">env</span><span class="p" data-group-id="9634693587-1">(</span><span class="p" data-group-id="9634693587-1">)</span><span class="w">
</span><span class="c1">#=&gt; :dev</span><span class="w">
</span><span class="nc">Mix.Project</span><span class="o">.</span><span class="n">build_path</span><span class="p" data-group-id="9634693587-2">(</span><span class="p" data-group-id="9634693587-2">)</span><span class="w">
</span><span class="c1">#=&gt; &quot;/path/to/project/_build/dev&quot;</span></code></pre>
  </section>
</div>
<div class="detail" id="build_structure/2">
  
    <span id="build_structure/0"></span>

    <span id="build_structure/1"></span>
  <div class="detail-header">
    <a href="#build_structure/2" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">build_structure(config \\ config(), opts \\ [])</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L565" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>build_structure(<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">keyword</a>(), <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">keyword</a>()) :: :ok</pre>
      </div>
  </div>
  <section class="docstring">
<p>Builds the project structure for the given application.</p>
<h2 id="build_structure/2-options" class="section-heading">
  <a href="#build_structure/2-options" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
  Options
</h2>

<ul>
<li><code class="inline">:symlink_ebin</code> - symlink ebin instead of copying it
</li>
</ul>
  </section>
</div>
<div class="detail" id="clear_deps_cache/0">
    <div class="detail-header">
    <a href="#clear_deps_cache/0" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">clear_deps_cache()</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L401" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
    
      <span class="note">(since 1.7.0)</span>
    
      <div class="specs">
          <pre>clear_deps_cache() :: :ok</pre>
      </div>
  </div>
  <section class="docstring">
<p>Clears the dependency for the current environment.</p>
<p>Useful when dependencies need to be reloaded due to change of global state.</p>
  </section>
</div>
<div class="detail" id="compile/2">
  
    <span id="compile/1"></span>
  <div class="detail-header">
    <a href="#compile/2" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">compile(args, config \\ [])</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L552" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>compile([<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">term</a>()], <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">keyword</a>()) :: <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">term</a>()</pre>
      </div>
  </div>
  <section class="docstring">
<p>Compiles the given project.</p>
  </section>
</div>
<div class="detail" id="compile_path/1">
  
    <span id="compile_path/0"></span>
  <div class="detail-header">
    <a href="#compile_path/1" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">compile_path(config \\ config())</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L520" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>compile_path(<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">keyword</a>()) :: <a href="https://hexdocs.pm/elixir/Path.html#t:t/0">Path.t</a>()</pre>
      </div>
  </div>
  <section class="docstring">
<p>Returns the paths the given project compiles to.</p>
<p>If no configuration is given, the one for the current project will be used.</p>
<p>The returned path will be expanded.</p>
<h2 id="compile_path/1-examples" class="section-heading">
  <a href="#compile_path/1-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
  Examples
</h2>

<pre><code class="nohighlight makeup elixir"><span class="nc">Mix.Project</span><span class="o">.</span><span class="n">compile_path</span><span class="p" data-group-id="1295864094-1">(</span><span class="p" data-group-id="1295864094-1">)</span><span class="w">
</span><span class="c1">#=&gt; &quot;/path/to/project/_build/dev/lib/app/ebin&quot;</span></code></pre>
  </section>
</div>
<div class="detail" id="config/0">
    <div class="detail-header">
    <a href="#config/0" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">config()</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L191" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>config() :: <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">keyword</a>()</pre>
      </div>
  </div>
  <section class="docstring">
<p>Returns the project configuration.</p>
<p>If there is no project defined, it still returns a keyword
list with default values. This allows many Mix tasks to work
without the need for an underlying project.</p>
<p>Note this configuration is cached once the project is
pushed onto the stack. Calling it multiple times won’t
cause it to be recomputed.</p>
<p>Do not use <a href="Mix.Project.html#config/0"><code class="inline">Mix.Project.config/0</code></a> to find the runtime configuration.
Use it only to configure aspects of your project (like
compilation directories) and not your application runtime.</p>
  </section>
</div>
<div class="detail" id="config_files/0">
    <div class="detail-header">
    <a href="#config_files/0" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">config_files()</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L209" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>config_files() :: [<a href="https://hexdocs.pm/elixir/Path.html#t:t/0">Path.t</a>()]</pre>
      </div>
  </div>
  <section class="docstring">
<p>Returns a list of project configuration files for this project.</p>
<p>This function is usually used in compilation tasks to trigger
a full recompilation whenever such configuration files change.</p>
<p>It returns the <code class="inline">mix.exs</code> file, the lock manifest, and all config
files in the <code class="inline">config</code> directory that do not start with a trailing
period (for example, <code class="inline">.my_config.exs</code>).</p>
  </section>
</div>
<div class="detail" id="config_mtime/0">
    <div class="detail-header">
    <a href="#config_mtime/0" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">config_mtime()</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L222" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
    
      <span class="note">(since 1.7.0)</span>
    
      <div class="specs">
          <pre>config_mtime() :: posix_mtime when posix_mtime: <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">integer</a>()</pre>
      </div>
  </div>
  <section class="docstring">
<p>Returns the latest modification time from config files.</p>
<p>This function is usually used in compilation tasks to trigger
a full recompilation whenever such configuration files change.
For this reason, the mtime is cached to avoid file system lookups.</p>
  </section>
</div>
<div class="detail" id="consolidation_path/1">
  
    <span id="consolidation_path/0"></span>
  <div class="detail-header">
    <a href="#consolidation_path/1" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">consolidation_path(config \\ config())</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L540" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
          </div>
  <section class="docstring">
<p>Returns the path where protocol consolidations are stored.</p>
<p>The returned path will be expanded.</p>
<h2 id="consolidation_path/1-examples" class="section-heading">
  <a href="#consolidation_path/1-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
  Examples
</h2>

<pre><code class="nohighlight makeup elixir"><span class="nc">Mix.Project</span><span class="o">.</span><span class="n">consolidation_path</span><span class="p" data-group-id="6696986545-1">(</span><span class="p" data-group-id="6696986545-1">)</span><span class="w">
</span><span class="c1">#=&gt; &quot;/path/to/project/_build/dev/lib/my_app/consolidated&quot;</span></code></pre>
<p>Inside umbrellas:</p>
<pre><code class="nohighlight makeup elixir"><span class="nc">Mix.Project</span><span class="o">.</span><span class="n">consolidation_path</span><span class="p" data-group-id="0363533691-1">(</span><span class="p" data-group-id="0363533691-1">)</span><span class="w">
</span><span class="c1">#=&gt; &quot;/path/to/project/_build/dev/consolidated&quot;</span></code></pre>
  </section>
</div>
<div class="detail" id="deps_path/1">
  
    <span id="deps_path/0"></span>
  <div class="detail-header">
    <a href="#deps_path/1" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">deps_path(config \\ config())</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L374" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>deps_path(<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">keyword</a>()) :: <a href="https://hexdocs.pm/elixir/Path.html#t:t/0">Path.t</a>()</pre>
      </div>
  </div>
  <section class="docstring">
<p>Returns the path where dependencies are stored for the given project.</p>
<p>If no configuration is given, the one for the current project is used.</p>
<p>The returned path will be expanded.</p>
<h2 id="deps_path/1-examples" class="section-heading">
  <a href="#deps_path/1-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
  Examples
</h2>

<pre><code class="nohighlight makeup elixir"><span class="nc">Mix.Project</span><span class="o">.</span><span class="n">deps_path</span><span class="p" data-group-id="6885437905-1">(</span><span class="p" data-group-id="6885437905-1">)</span><span class="w">
</span><span class="c1">#=&gt; &quot;/path/to/project/deps&quot;</span></code></pre>
  </section>
</div>
<div class="detail" id="deps_paths/0">
    <div class="detail-header">
    <a href="#deps_paths/0" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">deps_paths()</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L388" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>deps_paths() :: %{optional(<a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">atom</a>()) => <a href="https://hexdocs.pm/elixir/Path.html#t:t/0">Path.t</a>()}</pre>
      </div>
  </div>
  <section class="docstring">
<p>Returns the full path of all dependencies as a map.</p>
<h2 id="deps_paths/0-examples" class="section-heading">
  <a href="#deps_paths/0-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
  Examples
</h2>

<pre><code class="nohighlight makeup elixir"><span class="nc">Mix.Project</span><span class="o">.</span><span class="n">deps_paths</span><span class="p" data-group-id="8650211505-1">(</span><span class="p" data-group-id="8650211505-1">)</span><span class="w">
</span><span class="c1">#=&gt; %{foo: &quot;deps/foo&quot;, bar: &quot;custom/path/dep&quot;}</span></code></pre>
  </section>
</div>
<div class="detail" id="ensure_structure/2">
  
    <span id="ensure_structure/0"></span>

    <span id="ensure_structure/1"></span>
  <div class="detail-header">
    <a href="#ensure_structure/2" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">ensure_structure(config \\ config(), opts \\ [])</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L607" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>ensure_structure(<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">keyword</a>(), <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">keyword</a>()) :: :ok</pre>
      </div>
  </div>
  <section class="docstring">
<p>Ensures the project structure for the given project exists.</p>
<p>In case it does exist, it is a no-op. Otherwise, it is built.</p>
  </section>
</div>
<div class="detail" id="get!/0">
    <div class="detail-header">
    <a href="#get!/0" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">get!()</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L171" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>get!() :: <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">module</a>() | <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">no_return</a>()</pre>
      </div>
  </div>
  <section class="docstring">
<p>Same as <a href="#get/0"><code class="inline">get/0</code></a>, but raises an exception if there is no current project.</p>
<p>This is usually called by tasks that need additional
functions on the project to be defined. Since such
tasks usually depend on a project being defined, this
function raises a <a href="Mix.NoProjectError.html"><code class="inline">Mix.NoProjectError</code></a> exception in
case no project is available.</p>
  </section>
</div>
<div class="detail" id="get/0">
    <div class="detail-header">
    <a href="#get/0" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">get()</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L154" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>get() :: <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">module</a>() | nil</pre>
      </div>
  </div>
  <section class="docstring">
<p>Retrieves the current project if there is one.</p>
<p>If there is no current project, <code class="inline">nil</code> is returned. This
may happen in cases there is no <code class="inline">mix.exs</code> in the current
directory.</p>
<p>If you expect a project to be defined, i.e., it is a
requirement of the current task, you should call
<a href="#get!/0"><code class="inline">get!/0</code></a> instead.</p>
  </section>
</div>
<div class="detail" id="in_project/4">
  
    <span id="in_project/3"></span>
  <div class="detail-header">
    <a href="#in_project/4" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">in_project(app, path, post_config \\ [], fun)</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L354" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>in_project(<a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">atom</a>(), <a href="https://hexdocs.pm/elixir/Path.html#t:t/0">Path.t</a>(), <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">keyword</a>(), (<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">module</a>() -> result)) :: result
when result: <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">term</a>()</pre>
      </div>
  </div>
  <section class="docstring">
<p>Runs the given <code class="inline">fun</code> inside the given project.</p>
<p>This function changes the current working directory and
loads the project at the given directory onto the project
stack.</p>
<p>A <code class="inline">post_config</code> can be passed that will be merged into
the project configuration.</p>
<p><code class="inline">fun</code> is called with the module name of the given <a href="Mix.Project.html#content"><code class="inline">Mix.Project</code></a>.
The return value of this function is the return value of <code class="inline">fun</code>.</p>
<h2 id="in_project/4-examples" class="section-heading">
  <a href="#in_project/4-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
  Examples
</h2>

<pre><code class="nohighlight makeup elixir"><span class="nc">Mix.Project</span><span class="o">.</span><span class="n">in_project</span><span class="p" data-group-id="0251692169-1">(</span><span class="ss">:my_app</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;/path/to/my_app&quot;</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="0251692169-2">fn</span><span class="w"> </span><span class="n">module</span><span class="w"> </span><span class="o">-&gt;</span><span class="w">
  </span><span class="s">&quot;Mix project is: </span><span class="si" data-group-id="0251692169-3">#{</span><span class="n">inspect</span><span class="w"> </span><span class="n">module</span><span class="si" data-group-id="0251692169-3">}</span><span class="s">&quot;</span><span class="w">
</span><span class="k" data-group-id="0251692169-2">end</span><span class="p" data-group-id="0251692169-1">)</span><span class="w">
</span><span class="c1">#=&gt; &quot;Mix project is: MyApp.MixProject&quot;</span></code></pre>
  </section>
</div>
<div class="detail" id="load_paths/1">
  
    <span id="load_paths/0"></span>
  <div class="detail-header">
    <a href="#load_paths/1" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">load_paths(config \\ config())</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L619" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>load_paths(<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">keyword</a>()) :: [<a href="https://hexdocs.pm/elixir/Path.html#t:t/0">Path.t</a>()]</pre>
      </div>
  </div>
  <section class="docstring">
<p>Returns all load paths for the given project.</p>
  </section>
</div>
<div class="detail" id="manifest_path/1">
  
    <span id="manifest_path/0"></span>
  <div class="detail-header">
    <a href="#manifest_path/1" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">manifest_path(config \\ config())</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L464" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
        
      <div class="specs">
          <pre>manifest_path(<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">keyword</a>()) :: <a href="https://hexdocs.pm/elixir/Path.html#t:t/0">Path.t</a>()</pre>
      </div>
  </div>
  <section class="docstring">
<p>Returns the path where manifests are stored.</p>
<p>By default they are stored in the app path inside
the build directory. Umbrella applications have
the manifest path set to the root of the build directory.
Directories may be changed in future releases.</p>
<p>The returned path will be expanded.</p>
<h2 id="manifest_path/1-examples" class="section-heading">
  <a href="#manifest_path/1-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
  Examples
</h2>

<pre><code class="nohighlight makeup elixir"><span class="nc">Mix.Project</span><span class="o">.</span><span class="n">manifest_path</span><span class="p" data-group-id="5299432553-1">(</span><span class="p" data-group-id="5299432553-1">)</span><span class="w">
</span><span class="c1">#=&gt; &quot;/path/to/project/_build/shared/lib/app/.mix&quot;</span></code></pre>
  </section>
</div>
<div class="detail" id="umbrella?/1">
  
    <span id="umbrella?/0"></span>
  <div class="detail-header">
    <a href="#umbrella?/1" class="detail-link" title="Link to this function">
      <span class="icon-link" aria-hidden="true"></span>
      <span class="sr-only">Link to this function</span>
    </a>
    <span class="signature">umbrella?(config \\ config())</span>
      <a href="https://github.com/elixir-lang/elixir/blob/v1.7.2/lib/mix/lib/mix/project.ex#L235" class="view-source" rel="help" title="View Source">
       <span class="icon-code" aria-hidden="true"></span>
       <span class="sr-only">View Source</span>
     </a>
          </div>
  <section class="docstring">
<p>Returns <code class="inline">true</code> if <code class="inline">config</code> is the configuration for an umbrella project.</p>
<p>When called with no arguments, tells whether the current project is
an umbrella project.</p>
  </section>
</div>
        </section>

          <footer class="footer">
        <p>
          <span class="line">
            Built using
            <a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" target="_blank" rel="help noopener">ExDoc</a> (v0.19.1),
          </span>
          <span class="line">
            designed by
            <a href="https://twitter.com/dignifiedquire" target="_blank" rel="noopener" title="@dignifiedquire">Friedel Ziegelmayer</a>.
            </span>
        </p>
      </footer>
    </div>
  </div>
</section>
</div>
  <script src="dist/app-a0c90688fa.js"></script>
  
  </body>
</html>