summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Sloughter <tristan.sloughter@gmail.com>2015-04-25 11:02:35 -0500
committerTristan Sloughter <tristan.sloughter@gmail.com>2015-04-25 11:02:35 -0500
commit521fc144ae1243f2a91008fbec8fe9e5c3996bfb (patch)
tree7bb61a1b5b5c5ad6fda4c8358880eefa3605c422
parent459746c5b1d8c1c18f2f419e5c7c4b3e5b98092a (diff)
parent164cff406335cf6aebfe6d30bc95e85c0d0915d1 (diff)
Merge pull request #371 from tsloughter/fetch_app_details
read in application details into app_info after fetch
-rw-r--r--src/rebar_app_info.erl13
-rw-r--r--src/rebar_prv_install_deps.erl11
2 files changed, 23 insertions, 1 deletions
diff --git a/src/rebar_app_info.erl b/src/rebar_app_info.erl
index 7894e75..91640f2 100644
--- a/src/rebar_app_info.erl
+++ b/src/rebar_app_info.erl
@@ -157,6 +157,19 @@ app_file(AppInfo=#app_info_t{}, AppFile) ->
AppInfo#app_info_t{app_file=AppFile}.
-spec app_details(t()) -> list().
+app_details(AppInfo=#app_info_t{app_details=[]}) ->
+ AppFile = case app_file(AppInfo) of
+ undefined ->
+ app_file_src(AppInfo);
+ File ->
+ File
+ end,
+ case file:consult(AppFile) of
+ {ok, [{application, _, AppDetails}]} ->
+ AppDetails;
+ _ ->
+ []
+ end;
app_details(#app_info_t{app_details=AppDetails}) ->
AppDetails.
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl
index 3cd030a..e25e2c5 100644
--- a/src/rebar_prv_install_deps.erl
+++ b/src/rebar_prv_install_deps.erl
@@ -386,7 +386,7 @@ maybe_fetch(AppInfo, Profile, Upgrade, Seen, State) ->
case fetch_app(AppInfo, AppDir, State) of
true ->
maybe_symlink_default(State, Profile, AppDir, AppInfo),
- {true, AppInfo};
+ {true, update_app_info(AppInfo)};
Other ->
{Other, AppInfo}
end;
@@ -553,6 +553,15 @@ fetch_app(AppInfo, AppDir, State) ->
Result
end.
+update_app_info(AppInfo) ->
+ AppDetails = rebar_app_info:app_details(AppInfo),
+ Applications = proplists:get_value(applications, AppDetails, []),
+ IncludedApplications = proplists:get_value(included_applications, AppDetails, []),
+ AppInfo1 = rebar_app_info:applications(
+ rebar_app_info:app_details(AppInfo, AppDetails),
+ IncludedApplications++Applications),
+ rebar_app_info:valid(AppInfo1, false).
+
maybe_upgrade(AppInfo, AppDir, false, State) ->
Source = rebar_app_info:source(AppInfo),
rebar_fetch:needs_update(AppDir, Source, State);