rebar/rebar — pull request #123 by Motiejus (2013-08-15 17:30:22+00:00)
Title: Support for versioned shared dependencies

It is impossible to share a single deps with many projects, because the
dependency directories are not versioned

Instead of downloading dependency xxx to a shared ../deps/xxx now we
download to a shared dependency dir (for example ../deps/xxx-tag-1.2.3)
and then add a symlink from our local deps dir to the version we want.

With the local symlink we avoid issues with naming/addressing versioned
directories and we make it explicit which libraries we are using, which
is a good thing in case the shared dependency directory is used by many
projects. It does mean we have two dependency directories: the local one
and the shared one, we can add a new option for the shared deps. If it
is set, then follow the new flow so it is backwards compatible.

Implementation:

* add an option {shared_deps_dir, "../deps"} besides the currently
available {deps_dir, "deps"}
* via the OS environment REBAR_SHARED_DEPS_DIR we can set it globally
* if shared_deps_dir is set, then we download into that directory and
symlink from deps_dir to shared_deps_dir (and use deps_dir obviously)
* if not set, use the current logic of version resolution (unversioned
inside deps_dir)

Original implementation:
Thijs Terlouw @thijsterlouw
With improvements from:
Ignas Vyšniauskas @yfyf
Motiejus Jakštys

Original issue: https://github.com/basho/rebar/issues/257
We have been using this for way more than a year and it works great for us. This feature is completely optional, however, it really saves time when working on codebases with lots of dependencies. Please consider merging.