summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2014-11-19 17:52:57 -0600
committerTristan Sloughter <t@crashfast.com>2014-11-19 17:54:06 -0600
commit293c1b8e6e58db6d4ec567c0ed8744d69f94d94e (patch)
tree6182635cc4c9acf6130eebf07f2e3b6468a63c12 /src
parent2ba2002a80e29aaf6b295ad8cf4856c4a142920b (diff)
add applications field to app_info to track all deps of an application
Diffstat (limited to 'src')
-rw-r--r--src/rebar_app_discover.erl7
-rw-r--r--src/rebar_app_info.erl11
2 files changed, 15 insertions, 3 deletions
diff --git a/src/rebar_app_discover.erl b/src/rebar_app_discover.erl
index 4005612..a3a9168 100644
--- a/src/rebar_app_discover.erl
+++ b/src/rebar_app_discover.erl
@@ -119,7 +119,7 @@ create_app_info(AppDir, AppFile) ->
case file:consult(AppFile) of
{ok, [{application, AppName, AppDetails}]} ->
AppVsn = proplists:get_value(vsn, AppDetails),
- %AppDeps = proplists:get_value(applications, AppDetails, []),
+ Applications = proplists:get_value(applications, AppDetails, []),
C = rebar_config:consult(AppDir),
S = rebar_state:new(rebar_state:new(), C, AppDir),
AppDeps = rebar_state:deps_names(S),
@@ -134,8 +134,9 @@ create_app_info(AppDir, AppFile) ->
rebar_state:new()
end,
AppState1 = rebar_state:set(AppState, base_dir, AbsCwd),
- AppInfo1 = rebar_app_info:config(
- rebar_app_info:app_details(AppInfo, AppDetails), AppState1),
+ AppInfo1 = rebar_app_info:applications(rebar_app_info:config(
+ rebar_app_info:app_details(AppInfo, AppDetails)
+ ,AppState1), Applications),
rebar_app_info:dir(AppInfo1, AppDir);
_ ->
error
diff --git a/src/rebar_app_info.erl b/src/rebar_app_info.erl
index 47dfcad..f790cd3 100644
--- a/src/rebar_app_info.erl
+++ b/src/rebar_app_info.erl
@@ -18,6 +18,8 @@
original_vsn/1,
original_vsn/2,
ebin_dir/1,
+ applications/1,
+ applications/2,
deps/1,
deps/2,
dep_level/1,
@@ -37,6 +39,7 @@
config :: rebar_state:t() | undefined,
original_vsn :: binary() | string() | undefined,
app_details=[] :: list(),
+ applications=[] :: list(),
deps=[] :: list(),
dep_level=0 :: integer(),
dir :: file:name(),
@@ -155,6 +158,14 @@ original_vsn(#app_info_t{original_vsn=Vsn}) ->
original_vsn(AppInfo=#app_info_t{}, Vsn) ->
AppInfo#app_info_t{original_vsn=Vsn}.
+-spec applications(t()) -> list().
+applications(#app_info_t{applications=Applications}) ->
+ Applications.
+
+-spec applications(t(), list()) -> t().
+applications(AppInfo=#app_info_t{}, Applications) ->
+ AppInfo#app_info_t{applications=Applications}.
+
-spec deps(t()) -> list().
deps(#app_info_t{deps=Deps}) ->
Deps.