1app(5)                               Files                              app(5)
2
3
4

NAME

6       app - Application resource file.
7

DESCRIPTION

9       The  application  resource  file specifies the resources an application
10       uses, and how the application is started.  There  must  always  be  one
11       application  resource  file called Application.app for each application
12       Application in the system.
13
14       The file is read by the application controller when an  application  is
15       loaded/started. It is also used by the functions in systools, for exam‐
16       ple when generating start scripts.
17

FILE SYNTAX

19       The application resource file is to be  called  Application.app,  where
20       Application  is  the  application  name.  The  file is to be located in
21       directory ebin for the application.
22
23       The file must contain a single Erlang term, which is called an applica‐
24       tion specification:
25
26       {application, Application,
27         [{description,  Description},
28          {id,           Id},
29          {vsn,          Vsn},
30          {modules,      Modules},
31          {maxP,         MaxP},
32          {maxT,         MaxT},
33          {registered,   Names},
34          {included_applications, Apps},
35          {applications, Apps},
36          {env,          Env},
37          {mod,          Start},
38          {start_phases, Phases},
39          {runtime_dependencies, RTDeps}]}.
40
41                    Value                Default
42                    -----                -------
43       Application  atom()               -
44       Description  string()             ""
45       Id           string()             ""
46       Vsn          string()             ""
47       Modules      [Module]             []
48       MaxP         int()                infinity
49       MaxT         int()                infinity
50       Names        [Name]               []
51       Apps         [App]                []
52       Env          [{Par,Val}]          []
53       Start        {Module,StartArgs}   []
54       Phases       [{Phase,PhaseArgs}]  undefined
55       RTDeps       [ApplicationVersion] []
56
57       Module = Name = App = Par = Phase = atom()
58       Val = StartArgs = PhaseArgs = term()
59       ApplicationVersion = string()
60
61         Application:
62           Application name.
63
64       For  the  application controller, all keys are optional. The respective
65       default values are used for any omitted keys.
66
67       The functions in systools require more information. If they  are  used,
68       the following keys are mandatory:
69
70         * description
71
72         * vsn
73
74         * modules
75
76         * registered
77
78         * applications
79
80       The other keys are ignored by systools.
81
82         description:
83           A one-line description of the application.
84
85         id:
86           Product identification, or similar.
87
88         vsn:
89           Version of the application.
90
91         modules:
92           All modules introduced by this application. systools uses this list
93           when generating start scripts and tar files. A module can  only  be
94           defined in one application.
95
96         maxP:
97           Deprecated - is ignored
98
99           Maximum number of processes allowed in the application.
100
101         maxT:
102           Maximum  time,  in milliseconds, that the application is allowed to
103           run. After the specified time, the application terminates automati‐
104           cally.
105
106         registered:
107           All names of registered processes started in this application. sys‐
108           tools uses this list  to  detect  name  clashes  between  different
109           applications.
110
111         included_applications:
112           All  applications  included by this application. When this applica‐
113           tion is started, all included  applications  are  loaded  automati‐
114           cally,  but  not  started,  by  the  application  controller. It is
115           assumed that the top-most supervisor of the included application is
116           started by a supervisor of this application.
117
118         applications:
119           All  applications  that  must be started before this application is
120           allowed to be started. systools uses this list to generate  correct
121           start  scripts.  Defaults  to  the  empty list, but notice that all
122           applications have dependencies to (at least) Kernel and STDLIB.
123
124         env:
125           Configuration parameters used by the application. The  value  of  a
126           configuration   parameter   is   retrieved   by   calling  applica‐
127           tion:get_env/1,2. The values in the application resource  file  can
128           be  overridden by values in a configuration file (see config(4)) or
129           by command-line flags (see erts:erl(1)).
130
131         mod:
132           Specifies the application callback module and a start argument, see
133           application(3).
134
135           Key  mod  is necessary for an application implemented as a supervi‐
136           sion tree, otherwise the application controller does not  know  how
137           to start it. mod can be omitted for applications without processes,
138           typically code libraries, for example, STDLIB.
139
140         start_phases:
141           A list of start phases and corresponding start  arguments  for  the
142           application.  If  this  key  is present, the application master, in
143           addition to the usual  call  to  Module:start/2,  also  calls  Mod‐
144           ule:start_phase(Phase,Type,PhaseArgs)  for each start phase defined
145           by key start_phases. Only  after  this  extended  start  procedure,
146           application:start(Application) returns.
147
148           Start  phases  can be used to synchronize startup of an application
149           and its included applications. In this case, key mod must be speci‐
150           fied as follows:
151
152         {mod, {application_starter,[Module,StartArgs]}}
153
154           The  application  master  then calls Module:start/2 for the primary
155           application, followed by calls  to  Module:start_phase/3  for  each
156           start  phase (as defined for the primary application), both for the
157           primary application and for each of its included applications,  for
158           which the start phase is defined.
159
160           This  implies  that  for  an included application, the set of start
161           phases must be a subset of the set of phases defined for  the  pri‐
162           mary application. For more information, see OTP Design Principles.
163
164         runtime_dependencies:
165           A  list of application versions that the application depends on. An
166           example of such an application version is "kernel-3.0". Application
167           versions  specified  as  runtime  dependencies are minimum require‐
168           ments. That is, a larger application version than the one specified
169           in  the dependency satisfies the requirement. For information about
170           how to compare application versions, see section  Versions  in  the
171           System Principles User's Guide.
172
173           Notice  that  the  application version specifies a source code ver‐
174           sion. One more, indirect, requirement is that the installed  binary
175           application of the specified version is built so that it is compat‐
176           ible with the rest of the system.
177
178           Some dependencies can only be required in specific runtime  scenar‐
179           ios. When such optional dependencies exist, these are specified and
180           documented in the corresponding "App" documentation of the specific
181           application.
182
183     Warning:
184         The  runtime_dependencies key was introduced in OTP 17.0. The type of
185         its value might be subject to changes during the OTP 17 release.
186
187
188     Warning:
189         All runtime dependencies specified in OTP applications during the OTP
190         17  release  may  not  be  completely correct. This is actively being
191         worked on. Declared runtime  dependencies  in  OTP  applications  are
192         expected to be correct in OTP 18.
193
194

SEE ALSO

196       application(3), systools(3)
197
198
199
200Ericsson AB                       kernel 7.3                            app(5)
Impressum