app(5) | Files | app(5) |
app - Application resource file.
The application resource file specifies the resources an application uses, and how the application is started. There must always be one application resource file called Application.app for each application Application in the system.
The file is read by the application controller when an application is loaded/started. It is also used by the functions in systools, for example when generating start scripts.
The application resource file is to be called Application.app, where Application is the application name. The file is to be located in directory ebin for the application.
The file must contain a single Erlang term, which is called an application specification:
{application, Application, [{description, Description}, {id, Id}, {vsn, Vsn}, {modules, Modules}, {maxP, MaxP}, {maxT, MaxT}, {registered, Names}, {included_applications, Apps}, {optional_applications, Apps}, {applications, Apps}, {env, Env}, {mod, Start}, {start_phases, Phases}, {runtime_dependencies, RTDeps}]}. Value Default ----- ------- Application atom() - Description string() "" Id string() "" Vsn string() "" Modules [Module] [] MaxP int() infinity MaxT int() infinity Names [Name] [] Apps [App] [] Env [{Par,Val}] [] Start {Module,StartArgs} [] Phases [{Phase,PhaseArgs}] undefined RTDeps [ApplicationVersion] [] Module = Name = App = Par = Phase = atom() Val = StartArgs = PhaseArgs = term() ApplicationVersion = string()
For the application controller, all keys are optional. The respective default values are used for any omitted keys.
The functions in systools require more information. If they are used, the following keys are mandatory:
The other keys are ignored by systools.
Maximum number of processes allowed in the application.
systools uses this list to generate correct start scripts. Defaults to the empty list, but notice that all applications have dependencies to (at least) Kernel and STDLIB.
Key mod is necessary for an application implemented as a supervision tree, otherwise the application controller does not know how to start it. mod can be omitted for applications without processes, typically code libraries, for example, STDLIB.
Start phases can be used to synchronize startup of an application and its included applications. In this case, key mod must be specified as follows:
{mod, {application_starter,[Module,StartArgs]}}
The application master then calls Module:start/2 for the primary application, followed by calls to Module:start_phase/3 for each start phase (as defined for the primary application), both for the primary application and for each of its included applications, for which the start phase is defined.
This implies that for an included application, the set of start phases must be a subset of the set of phases defined for the primary application. For more information, see OTP Design Principles.
Notice that the application version specifies a source code version. One more, indirect, requirement is that the installed binary application of the specified version is built so that it is compatible with the rest of the system.
Some dependencies can only be required in specific runtime scenarios. When such optional dependencies exist, these are specified and documented in the corresponding "App" documentation of the specific application.
application(3erl), systools(3erl)
kernel 8.5.4.2 | Ericsson AB |