Skip to content

Commit

Permalink
Merge pull request #799 from tsloughter/tree_output
Browse files Browse the repository at this point in the history
parse versions in deps tree output and support checkouts
  • Loading branch information
ferd committed Sep 12, 2015
2 parents adb2550 + ef8fc6a commit 0dc2325
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/rebar_app_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ dep_to_app(Parent, DepsDir, Name, Vsn, Source, IsLock, State) ->
CheckoutsDir = ec_cnv:to_list(rebar_dir:checkouts_dir(State, Name)),
AppInfo = case rebar_app_info:discover(CheckoutsDir) of
{ok, App} ->
rebar_app_info:is_checkout(App, true);
rebar_app_info:source(rebar_app_info:is_checkout(App, true), checkout);
not_found ->
Dir = ec_cnv:to_list(filename:join(DepsDir, Name)),
{ok, AppInfo0} =
Expand Down
9 changes: 7 additions & 2 deletions src/rebar_prv_deps_tree.erl
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@ format_error(Reason) ->
%% Internal functions

print_deps_tree(SrcDeps, Verbose, State) ->
Resources = rebar_state:resources(State),
D = lists:foldl(fun(App, Dict) ->
Name = rebar_app_info:name(App),
Vsn = rebar_app_info:original_vsn(App),
AppDir = rebar_app_info:dir(App),
Vsn1 = rebar_utils:vcs_vsn(Vsn, AppDir, Resources),
Source = rebar_app_info:source(App),
Parent = rebar_app_info:parent(App),
dict:append_list(Parent, [{Name, Vsn, Source}], Dict)
dict:append_list(Parent, [{Name, Vsn1, Source}], Dict)
end, dict:new(), SrcDeps),
ProjectAppNames = [{rebar_app_info:name(App)
,rebar_app_info:original_vsn(App)
,rebar_utils:vcs_vsn(rebar_app_info:original_vsn(App), rebar_app_info:dir(App), Resources)
,project} || App <- rebar_state:project_apps(State)],
io:setopts([{encoding, unicode}]),
case dict:find(root, D) of
Expand Down Expand Up @@ -80,6 +83,8 @@ print_children(Prefix, [{Name, Vsn, Source} | Rest], Dict, Verbose) ->

type(project, _) ->
"project app";
type(checkout, _) ->
"checkout app";
type(Source, Verbose) when is_tuple(Source) ->
case {element(1, Source), Verbose} of
{pkg, _} ->
Expand Down

0 comments on commit 0dc2325

Please sign in to comment.