diff options
Diffstat (limited to 'src/rlx_app_discovery.erl')
-rw-r--r-- | src/rlx_app_discovery.erl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/rlx_app_discovery.erl b/src/rlx_app_discovery.erl index dcd2604..0414a0a 100644 --- a/src/rlx_app_discovery.erl +++ b/src/rlx_app_discovery.erl @@ -290,13 +290,24 @@ get_vsn(AppDir, AppName, AppDetail) -> end end. --spec get_deps(file:name(), atom(), string(), proplists:proplist()) -> +-spec get_deps(binary(), atom(), string(), proplists:proplist()) -> {ok, rlx_app_info:t()} | {error, Reason::term()}. get_deps(AppDir, AppName, AppVsn, AppDetail) -> - ActiveApps = proplists:get_value(applications, AppDetail, []), + %% ensure that at least stdlib and kernel are defined as application deps + ActiveApps = ensure_stdlib_kernel(AppName, + proplists:get_value(applications, AppDetail, [])), LibraryApps = proplists:get_value(included_applications, AppDetail, []), rlx_app_info:new(AppName, AppVsn, AppDir, ActiveApps, LibraryApps). +-spec ensure_stdlib_kernel(AppName :: atom(), + Apps :: list(atom())) -> list(atom()). +ensure_stdlib_kernel(kernel, Deps) -> Deps; +ensure_stdlib_kernel(stdlib, Deps) -> Deps; +ensure_stdlib_kernel(_AppName, []) -> + %% minimum required deps are kernel and stdlib + [kernel, stdlib]; +ensure_stdlib_kernel(_AppName, Deps) -> Deps. + %%%=================================================================== %%% Test Functions %%%=================================================================== |