summaryrefslogtreecommitdiffstats
path: root/docs/en/erlang.mk/1/guide/deps/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/en/erlang.mk/1/guide/deps/index.html')
-rw-r--r--docs/en/erlang.mk/1/guide/deps/index.html152
1 files changed, 24 insertions, 128 deletions
diff --git a/docs/en/erlang.mk/1/guide/deps/index.html b/docs/en/erlang.mk/1/guide/deps/index.html
index ad4a3523..780aaf56 100644
--- a/docs/en/erlang.mk/1/guide/deps/index.html
+++ b/docs/en/erlang.mk/1/guide/deps/index.html
@@ -109,11 +109,7 @@ http://www.gnu.org/software/src-highlite -->
<div class="paragraph"><p>Once you find the package you need, adding it as a dependency
to your project is a one-liner:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">DEPS =</span> cowboy</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>And that&#8217;s it! The next time you run <code>make</code>, Erlang.mk will
fetch and compile Cowboy. Erlang.mk will also ensure Cowboy
is available whenever you use the shell, run tests and any
@@ -128,20 +124,11 @@ dependencies.</p></div>
<div class="paragraph"><p>For example, you could add a parse transform project like
this to make it available only at build time:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">BUILD_DEPS =</span> erlando</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>Or you could depend on a C project directly, if you are
building a NIF:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">BUILD_DEPS =</span> leveldb
-<span style="color: #009900">dep_leveldb =</span> git https<span style="color: #990000">:</span>//github.com/basho/leveldb 2.1.3</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>This dependency will be built before your application, so
you could easily copy the resulting shared file into your
<em>priv/</em> directory as part of the build process. More information
@@ -155,43 +142,22 @@ Do note that there is no way to choose the version, the
application used will be the one already on your system.</p></div>
<div class="paragraph"><p>You could depend on the Crypto application, for example:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">LOCAL_DEPS =</span> crypto</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>Erlang.mk comes with additional types of dependencies.
It has <code>TEST_DEPS</code> for dependencies used only for testing:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">TEST_DEPS =</span> ct_helper
-<span style="color: #009900">dep_ct_helper =</span> git https<span style="color: #990000">:</span>//github.com/ninenines/ct_helper master</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p><code>DOC_DEPS</code> for dependencies used only when building documentation:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">DOC_DEPS =</span> edown</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p><code>REL_DEPS</code> for dependencies required to build the release,
or to include extra applications in the release:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">REL_DEPS =</span> recon</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>And <code>SHELL_DEPS</code> for dependencies to make available when running
the <code>make shell</code> command:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">SHELL_DEPS =</span> tddreloader</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>All these will be documented in more details in their respective
chapters.</p></div>
<div class="sect3">
@@ -200,11 +166,7 @@ chapters.</p></div>
find the project you are looking for, if you only provide
its name. This is this case:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">DEPS =</span> cowboy</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>If you need a different version, you need to define another
variable. There are two ways to do this, each being useful
for different reasons.</p></div>
@@ -212,12 +174,7 @@ for different reasons.</p></div>
need to do is to define the <code>dep_$(DEP_NAME)_commit</code>
variable. In the case of Cowboy, this would look like this:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">DEPS =</span> cowboy
-<span style="color: #009900">dep_cowboy_commit =</span> 2.0.0-pre.2</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>Erlang.mk will use the package index to get all information
about Cowboy, except the commit number which will be overriden.</p></div>
<div class="paragraph"><p>If you need to set the fetch method or repository information
@@ -225,12 +182,7 @@ too, for example because you want to use your own fork, or
simply because the project is missing from the index, you
can define the <code>dep_$(DEP_NAME)</code> variable with everything:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">DEPS =</span> cowboy
-<span style="color: #009900">dep_cowboy =</span> git https<span style="color: #990000">:</span>//github.com/essen/cowboy 2.0.0-pre.2</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>This will fetch Cowboy from your fork at the given commit.</p></div>
</div>
<div class="sect3">
@@ -304,61 +256,33 @@ You can use any valid commit, tag or branch in that repository
for the commit value.</p></div>
<div class="paragraph"><p>For example, to fetch Cowboy with tag 2.0.0-pre.2 from Git:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">dep_cowboy =</span> git https<span style="color: #990000">:</span>//github.com/ninenines/cowboy 2.0.0-pre.2</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>Or to fetch Ehsa tag 4.0.3 from Mercurial:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">dep_ehsa =</span> hg https<span style="color: #990000">:</span>//bitbucket.org/a12n/ehsa 4.0.3</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>Git also comes with a concept of submodules. Erlang.mk can
automatically initializes and updates submodules for dependencies,
as long as they were added beforehand using <code>git submodule add</code>:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">dep_cowboy =</span> git-submodule</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>The <code>svn</code> method only has a repository value, but that&#8217;s
simply because the SVN repository URL can also contain
the path and commit.</p></div>
<div class="paragraph"><p>This would fetch an example project from the trunk:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">dep_ex1 =</span> svn https<span style="color: #990000">:</span>//example.com/svn/trunk/project/ex<span style="color: #993399">1</span></tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>And this would fetch a separate example project from a
specific commit:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">dep_ex2 =</span> svn svn<span style="color: #990000">:</span>//example.com/svn/branches/erlang-proj/ex<span style="color: #993399">2</span>@<span style="color: #993399">264</span></tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>You can copy a directory from your machine using the <code>cp</code> method.
It only takes the path to copy from:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">dep_cowboy =</span> cp <span style="color: #009900">$(HOME)</span>/ninenines/cowboy</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>Finally, you can use a package from the
<a href="https://hex.pm/">Hex repository</a>:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">dep_cowboy =</span> hex 1.0.3</tt></pre></div></div>
+<div class="content"></div></div>
</div>
<div class="sect3">
<h4 id="_custom_fetch_methods">Custom fetch methods</h4>
@@ -371,14 +295,7 @@ Or in layman terms, if your dependency is Cowboy, this would
become <em>deps/cowboy</em>.</p></div>
<div class="paragraph"><p>To give an example, this is what the Git method does:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt>define dep_fetch_git
- git clone -q -n -- <span style="color: #009900">$(</span>call dep_repo<span style="color: #990000">,</span><span style="color: #009900">$1</span><span style="color: #990000">)</span> <span style="color: #009900">$(DEPS_DIR)</span><span style="color: #990000">/</span><span style="color: #009900">$(</span>call dep_name<span style="color: #990000">,</span><span style="color: #009900">$1</span><span style="color: #990000">);</span> <span style="color: #990000">\</span>
- cd <span style="color: #009900">$(DEPS_DIR)</span><span style="color: #990000">/</span><span style="color: #009900">$(</span>call dep_name<span style="color: #990000">,</span><span style="color: #009900">$1</span><span style="color: #990000">)</span> <span style="color: #990000">&amp;&amp;</span> git checkout -q <span style="color: #009900">$(</span>call dep_commit<span style="color: #990000">,</span><span style="color: #009900">$1</span><span style="color: #990000">);</span>
-endef</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>Note that, like dependency information, this custom fetch method
must be written before including <em>erlang.mk</em>.</p></div>
</div>
@@ -452,20 +369,11 @@ on your system.</p></div>
<div class="paragraph"><p>To ignore a dependency, simply add it to the <code>IGNORE_DEPS</code>
variable:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt>IGNORE_DEPS <span style="color: #990000">+=</span> edown proper</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>This will only ignore dependencies that are needed for
building. It is therefore safe to write:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt>IGNORE_DEPS <span style="color: #990000">+=</span> edown proper
-<span style="color: #009900">TEST_DEPS =</span> proper</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>The PropEr application will be fetched as intended when
running <code>make tests</code> or <code>make check</code>. It will however
not be fetched when running <code>make</code> or <code>make deps</code>.</p></div>
@@ -483,11 +391,7 @@ own dependencies.</p></div>
if you know you will never use this project as a dependency,
<code>=</code> will work. But to avoid it biting you later on, do this:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt>DEPS_DIR <span style="color: #990000">?=</span> <span style="color: #009900">$(CURDIR)</span>/libs</tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>The <code>$(CURDIR)</code> part is important, otherwise dependencies of
dependencies will be fetched in the wrong directory.</p></div>
<div class="paragraph"><p>Erlang.mk will also export the <code>REBAR_DEPS_DIR</code> variable for
@@ -656,19 +560,11 @@ Other projects with no Makefile are left untouched.
<div class="paragraph"><p>You can disable the replacing of the <em>erlang.mk</em> file by
defining the <code>NO_AUTOPATCH_ERLANG_MK</code> variable:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">NO_AUTOPATCH_ERLANG_MK =</span> <span style="color: #993399">1</span></tt></pre></div></div>
+<div class="content"></div></div>
<div class="paragraph"><p>You can also disable autopatch entirely for a few select
projects using the <code>NO_AUTOPATCH</code> variable:</p></div>
<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">NO_AUTOPATCH =</span> cowboy ranch cowlib</tt></pre></div></div>
+<div class="content"></div></div>
</div>
</div>
<div class="sect1">