aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Rascao <[email protected]>2017-01-04 19:22:32 +0000
committerLuis Rascao <[email protected]>2017-03-20 23:08:03 +0000
commit3a5137a9dca04c02b52d787aaec6630e721d0e08 (patch)
treeda13d712f381b04bed63ed4e96e59e76982082a8
parentaff9fca98f84f8031696a96d85a57eb398355f35 (diff)
downloadrelx-3a5137a9dca04c02b52d787aaec6630e721d0e08.tar.gz
relx-3a5137a9dca04c02b52d787aaec6630e721d0e08.tar.bz2
relx-3a5137a9dca04c02b52d787aaec6630e721d0e08.zip
Ensure stdlib,kernel as application dependencies
Make this dependency explicit as it was causing apps with empty application lists to not be included in the generated release.
-rw-r--r--src/rlx_app_discovery.erl12
-rw-r--r--test/rlx_release_SUITE.erl2
2 files changed, 12 insertions, 2 deletions
diff --git a/src/rlx_app_discovery.erl b/src/rlx_app_discovery.erl
index 56ac59c..aab1d3b 100644
--- a/src/rlx_app_discovery.erl
+++ b/src/rlx_app_discovery.erl
@@ -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
%%%===================================================================
diff --git a/test/rlx_release_SUITE.erl b/test/rlx_release_SUITE.erl
index c9430fd..3323bed 100644
--- a/test/rlx_release_SUITE.erl
+++ b/test/rlx_release_SUITE.erl
@@ -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"]))).