[erlang-questions] How do I include a library across muiltple apps in a release?

Dale Harvey <>
Sat Aug 30 17:59:46 CEST 2008


Yes sorry, I was saying create an application for the single module

/myrel
    |- lib/
        |- singlemodule-1.0/
            |- src/
               |- mymodule.erl
            |- ebin/
               |- singlemodule.app
        |- app2/...
        |- app3/...

with singlemodule.app looking like

{application, singlemodule, [
  {description, "Description"},
  {vsn, "1.0"},
  {modules,[mymodule]},
  {registered,[]},
  {applications, [kernel, stdlib]}
]}.

You dont need supervisors / servers to start and stop etc, it just makes
sure theres no name conflicts and that its in the path

2008/8/30 Mazen Harake <>

> You should do as you already suggested... make a library application. It
> is not overkill, it is good practice. If you add it to your rel-file and
> use OTP release handling with that then the library will always be part
> of your release. This is a good thing
> /Mazen
>
> Matt Williamson wrote:
> > To make things clear. My goal is to share a library module across
> > multiple application in a release, but I'm not quite sure how to go
> > about it.
> >
> > On Sat, Aug 30, 2008 at 8:22 AM, Dale Harvey <
> > <mailto:>> wrote:
> >
> >     you only need to write a .app file
> >     from http://erlang.org/doc/design_principles/applications.html#7
> >
> >     The contents of a minimal .app file for a library application
> >     libapp looks like this:
> >
> >     {application, libapp, []}.
> >
> >
> >     (I think the docs might be misleading though, I got errors using
> >     the minimal,
> >     this is what I use
> >
> >     {application, appname, [
> >       {description, "Description"},
> >       {vsn, "1.0"},
> >       {modules,[]},
> >       {registered,[]},
> >       {applications, [kernel, stdlib]}
> >     ]}.
> >
> >     then have systools find that app file when generating the .rel
> >
> >     2008/8/30 Matt Williamson <
> >     <mailto:>>
> >
> >         Let's say I have a typical release directory like so:
> >
> >         /myrel
> >             |- lib/
> >                 |- app1/
> >                     |- src/
> >                     |- ebin/
> >                     |- include/
> >                     |- doc/
> >                 |- app2/...
> >                 |- app3/...
> >
> >         How would I include a single module, which can be called by
> >         modules in all of the applications? The only two ways I can
> >         think of is make it into an app (I personally think that's
> >         overkill because I just want to call a function in the module)
> >         or make a symlink, which won't work in windows.
> >
> >         _______________________________________________
> >         erlang-questions mailing list
> >          <mailto:>
> >         http://www.erlang.org/mailman/listinfo/erlang-questions
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://www.erlang.org/mailman/listinfo/erlang-questions
>
>
> --
> Mazen Harake <>
> Erlang Software Developer and Consultant,
> Erlang Training & Consulting, Ltd
>
> Mobile Phone: +44 (0)795 13 26 317
> Office Phone: +44 (0)207 45 61 020
> Office Address:
> 401 London Fruit & Wool Exchange
> Brushfield St, London, E1 6EL
> United Kingdom
>
> This email and its attachments may be confidential and are intended solely
> for the use of the individual to whom it is addressed. Any views or opinions
> expressed are solely those of the author and do not necessarily represent
> those of "Erlang Training & Consulting, Ltd".
>
> If you are not the intended recipient of this email and its attachments,
> you must take no action based upon them, nor must you copy or show them to
> anyone. Please contact the sender if you believe you have received this
> email in error.
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080830/16d3556d/attachment.html>


More information about the erlang-questions mailing list