CommonX v0.4.0 ApplicationX View Source
Application module extended functions.
Link to this section Summary
Functions
List all available applications excluding system ones.
List all dependant applications excluding system ones. Does includes the given application.
The atom of the current main application.
List all available modules excluding system ones.
List all available modules for the given app[s] and dependencies of those apps. This excludes system modules.
Link to this section Functions
List all available applications excluding system ones.
This function is save to run in Mix.Task
s.
Example
Since :common_x
does not have any dependencies:
iex> ApplicationX.applications
[:common_x]
List all dependant applications excluding system ones. Does includes the given application.
This function is save to run in Mix.Task
s.
Example
Since :common_x
does not have any dependencies:
iex> ApplicationX.applications(:common_x)
[:common_x]
Duplicates are ignored and only returned once:
iex> ApplicationX.applications([:common_x, :common_x])
[:common_x]
Unknown applications are safe, but returned:
iex> ApplicationX.applications(:fake)
[:fake]
The atom of the current main application.
For example take an application called :my_app
,
which includes the :my_dep
dependencies,
which has :common_x
as dependency.
So:
:my_app
├── ...
└── :my_dep
├── ...
└── :common_x
In that scenario calling ApplicationX.main
will return in :my_app
both for code in :my_app
and :my_dep
.
Examples
iex> ApplicationX.main
:common_x
List all available modules excluding system ones.
This function is save to run in Mix.Task
s.
Example
Since :common_x
does not have any dependencies:
iex> ApplicationX.modules
[ApplicationX, CommonX, EnumX, MacroX, MapX]
List all available modules for the given app[s] and dependencies of those apps. This excludes system modules.
This function is save to run in Mix.Task
s.
Example
Normally system modules are excluded, but can be added by manually passing the respective system application:
iex> ApplicationX.modules(:logger)
[Logger, Logger.App, Logger.BackendSupervisor, Logger.Backends.Console,
Logger.Config, Logger.ErlangHandler, Logger.ErrorHandler, Logger.Formatter,
Logger.Translator, Logger.Utils, Logger.Watcher]
Duplicate applications are ignored:
iex> ApplicationX.modules([:logger, :logger])
[Logger, Logger.App, Logger.BackendSupervisor, Logger.Backends.Console,
Logger.Config, Logger.ErlangHandler, Logger.ErrorHandler, Logger.Formatter,
Logger.Translator, Logger.Utils, Logger.Watcher]
Unknown applications are safe to pass:
iex> ApplicationX.modules(:fake)
[]