summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar_app_discover.erl3
-rw-r--r--src/rebar_digraph.erl3
-rw-r--r--src/rebar_prv_install_deps.erl3
3 files changed, 9 insertions, 0 deletions
diff --git a/src/rebar_app_discover.erl b/src/rebar_app_discover.erl
index a79611d..e2ef179 100644
--- a/src/rebar_app_discover.erl
+++ b/src/rebar_app_discover.erl
@@ -153,6 +153,8 @@ dedup([A]) -> [A];
dedup([H,H|T]) -> dedup([H|T]);
dedup([H|T]) -> [H|dedup(T)].
+%% Read in and parse the .app file if it is availabe. Do the same for
+%% the .app.src file if it exists.
try_handle_app_file([], AppDir, AppSrcFile, Validate) ->
try_handle_app_src_file([], AppDir, AppSrcFile, Validate);
try_handle_app_file([File], AppDir, AppSrcFile, Validate) ->
@@ -193,6 +195,7 @@ try_handle_app_file([File], AppDir, AppSrcFile, Validate) ->
try_handle_app_file(Other, _AppDir, _AppSrcFile, _Validate) ->
throw({error, {multiple_app_files, Other}}).
+%% Read in the .app.src file if we aren't looking for a valid (already built) app
try_handle_app_src_file(_, _AppDir, [], _Validate) ->
false;
try_handle_app_src_file(_, _AppDir, _AppSrcFile, valid) ->
diff --git a/src/rebar_digraph.erl b/src/rebar_digraph.erl
index 7f7909e..d52a811 100644
--- a/src/rebar_digraph.erl
+++ b/src/rebar_digraph.erl
@@ -124,6 +124,9 @@ find_app_by_name(Name, Apps) ->
rebar_app_info:name(App) =:= Name
end, Apps).
+%% The union of all entries in the applications list for an app and
+%% the deps listed in its rebar.config is all deps that may be needed
+%% for building the app.
all_apps_deps(App) ->
Applications = lists:usort([atom_to_binary(X, utf8) || X <- rebar_app_info:applications(App)]),
Deps = lists:usort(lists:map(fun({Name, _}) -> Name; (Name) -> Name end, rebar_app_info:deps(App))),
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl
index 90bd70c..80fdbc3 100644
--- a/src/rebar_prv_install_deps.erl
+++ b/src/rebar_prv_install_deps.erl
@@ -575,6 +575,9 @@ fetch_app(AppInfo, AppDir, State) ->
throw(Error)
end.
+%% This is called after the dep has been downloaded and unpacked, if it hadn't been already.
+%% So this is the first time for newly downloaded apps that its .app/.app.src data can
+%% be read in an parsed.
update_app_info(AppDir, AppInfo) ->
{ok, Found} = rebar_app_info:discover(AppDir),
AppDetails = rebar_app_info:app_details(Found),