[erlang-questions] include as a library rather than an application?

JD Bothma jbothma@REDACTED
Sun Apr 6 15:35:22 CEST 2014


For more detail, search for library at
http://www.erlang.org/doc/design_principles/applications.html. You should
skip the mod entry in .app

A library application, which can not be started or stopped, does not need
any application callback module.
7.3  Application Resource File

To define an application, we create an *application specification* which is
put in an *application resource file*, or in short .app file:

{application, Application, [Opt1,...,OptN]}.

Application, an atom, is the name of the application. The file must be
named Application.app.

Each Opt is a tuple {Key, Value} which define a certain property of the
application. All keys are optional. Default values are used for any omitted
keys.

The contents of a minimal .app file for a library application libapp looks
like this:

{application, libapp, []}.

The contents of a minimal .app file ch_app.app for a supervision tree
application like ch_app looks like this:

{application, ch_app,
 [{mod, {ch_app,[]}}]}.




On 6 April 2014 09:09, Loïc Hoguin <essen@REDACTED> wrote:

> You don't need the app behaviour to do that.
>
> --
> Loïc Hoguin
> http://ninenines.eu
>
>
> -------- Original Message --------
> From:t x <txrev319@REDACTED>
> Sent:Sun, 06 Apr 2014 06:19:35 +0200
> To:erlang-questions@REDACTED
> Subject:[erlang-questions] include as a library rather than an application?
>
> Hi,
>
> For this problem has a "working hack" -- but I'd prefer to do it without a
> hack.
>
> I'm including erldn in my app.src as:
>
> {applications, [kernel, stdlib, cowboy, gproc, erldn]},
>
>
> To do this, erldn must have an application behaviour. Thus, I was forced
> to add:
>
>
> https://github.com/txrev319/erldn/blob/d607db5d3826a7f3ad0eff918c8c7691a362ad94/src/erldn_app.erl
>
>
> a no-op file to make it an application.
>
>
> My question: is there a way to include erldn as a library rather than
> an application? I.e. I want access to erldn:parse_str(...) . However,
> I don't want to spawn an app just to include erldn.
>
>
> Thanks!
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140406/fbae29a3/attachment.htm>


More information about the erlang-questions mailing list