Skip to content

Commit

Permalink
Merge pull request #567 from lrascao/feature/empty_application_apps_s…
Browse files Browse the repository at this point in the history
…ilently_skipped

Ensure stdlib,kernel as application dependencies
  • Loading branch information
tsloughter authored Mar 20, 2017
2 parents aff9fca + 3a5137a commit c1e3796
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/rlx_app_discovery.erl
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,20 @@ get_vsn(AppDir, AppName, AppDetail) ->
-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, Deps) ->
%% ensure that stdlib and kernel are the first deps
[kernel, stdlib | Deps -- [stdlib, kernel]].

%%%===================================================================
%%% Test Functions
%%%===================================================================
2 changes: 1 addition & 1 deletion test/rlx_release_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ make_exclude_modules_release(Config) ->
{modules,[]},
{included_applications,[]},
{registered,[]},
{applications,[stdlib,kernel]}]}]},
{applications,[kernel,stdlib]}]}]},
file:consult(filename:join([OutputDir, "foo", "lib",
"non_goal_1-0.0.1", "ebin",
"non_goal_1.app"]))).
Expand Down

0 comments on commit c1e3796

Please sign in to comment.