I have a project with several dependencies on remote repositories (all on github.com at the moment if that helps). The dependencies don't change often. It would be nice if there was a way to keep the existing rebar.conf files the same so that they pointed to the upstream repositories, but to be able to cache the repos (or a snapshot) locally so that clean builds don't need go to the internet.
Is there anyway of doing this? Ie rebar command line options, environment settings, git options, etc.?
I suppose you could do couple of things:
rebar.config
to take this repos from it. On the first look it seems horrible solution, but it has a lot of advantages. Github is often not available, clone speed will increase, and the last most valuable is: projects are evolving and one day you will find that everything is broken because one of the deps has changed their APi in master branch. Rebar has a feature that lets you add a custom script file, rebar.config.script, to modify rebar's configuration dynamically. This lets you implement something similar to @danechkin's answer #2 except using an environment variable to switch between the local shared deps folder and the default one for the project. No changes to rebar.config needed. The example at https://github.com/basho/rebar/wiki/Dynamic-configuration shows how to do this.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.