[erlang-questions] Including other peoples code in my code in a future proof way

Joe Armstrong erlang@REDACTED
Tue Mar 17 14:53:12 CET 2015

How do I include another application in my application?

I've written a program that I want to distibute.
I'll make it available on github.

The problem is that my program uses cowboy and a few other
things (which are also on github)

I'd like my program to work "out of the box" - just type Make and off
you go.

I'd also like my to work for a long time so if rebar and
cowboy change in the future I'd like my program to still build

Now what I could do is:

    use rebar and a rebar.config file that point to cowboy etc.

My rebar-config is like this

{deps, [
  {cowboy, ".*", {git, "git://github.com/extend/cowboy.git", "master"}}

The problem with this is that

   1) my version of rebar might not be the same as on the target machine
      where the makefile is run
   2) The cowboy reference is to "the latest version" and not
      an immutable version that I know works

So How should I fix this? Is the answer:

    a) Include rebar in my distribution
      (I don't really like this, since I'd just like to have my code in
       my project archive)
    b) Point to a absolute version of cowboy - but how do I do this?

Or c)
      Include all the source code of cowboy etc in my release

I also don't want mutiple versions of rebar and libraries in different
directories, branches, views or whatever you call them.

What's the best thing to do here?



More information about the erlang-questions mailing list