summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2014-09-26 09:22:25 -0500
committerTristan Sloughter <t@crashfast.com>2014-09-26 09:22:25 -0500
commit3f9ff5a30221919b1ce4f65bbefcebe360c09ecb (patch)
treeabf0f28ccfaf9141bbdb3796d23e7267d8be86b2 /src
parente392bfaec3942e63a88bb86a676fe4755ba84ce3 (diff)
fix compilation order
Diffstat (limited to 'src')
-rw-r--r--src/rebar_app_discover.erl21
-rw-r--r--src/rebar_prv_install_deps.erl9
-rw-r--r--src/rebar_topo.erl2
3 files changed, 18 insertions, 14 deletions
diff --git a/src/rebar_app_discover.erl b/src/rebar_app_discover.erl
index a4cfe4c..9fa7b4a 100644
--- a/src/rebar_app_discover.erl
+++ b/src/rebar_app_discover.erl
@@ -110,8 +110,9 @@ 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, []),
AbsCwd = filename:absname(rebar_utils:get_cwd()),
- {ok, AppInfo} = rebar_app_info:new(AppName, AppVsn, AppDir),
+ {ok, AppInfo} = rebar_app_info:new(AppName, AppVsn, AppDir, AppDeps),
RebarConfig = filename:join(AppDir, "rebar.config"),
AppState = case filelib:is_file(RebarConfig) of
true ->
@@ -131,13 +132,17 @@ create_app_info(AppDir, AppFile) ->
-spec validate_application_info(rebar_app_info:t()) -> boolean().
validate_application_info(AppInfo) ->
EbinDir = rebar_app_info:ebin_dir(AppInfo),
- AppFile = rebar_app_info:app_file(AppInfo),
- AppDetail = rebar_app_info:app_details(AppInfo),
- case get_modules_list(AppFile, AppDetail) of
- {ok, List} ->
- has_all_beams(EbinDir, List);
- _Error ->
- false
+ case rebar_app_info:app_file(AppInfo) of
+ undefined ->
+ false;
+ AppFile ->
+ AppDetail = rebar_app_info:app_details(AppInfo),
+ case get_modules_list(AppFile, AppDetail) of
+ {ok, List} ->
+ has_all_beams(EbinDir, List);
+ _Error ->
+ false
+ end
end.
-spec get_modules_list(file:filename_all(), proplists:proplist()) ->
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl
index 2498215..de4be27 100644
--- a/src/rebar_prv_install_deps.erl
+++ b/src/rebar_prv_install_deps.erl
@@ -74,7 +74,7 @@ do(State) ->
handle_deps(State, Locks)
end,
- Source = ProjectApps ++ rebar_state:src_deps(State1),
+ Source = ProjectApps ++ rebar_state:get(State1, all_deps),
{ok, Sort} = rebar_topo:sort_apps(Source),
{ok, rebar_state:set(State1, deps_to_build, lists:dropwhile(fun is_valid/1, Sort -- ProjectApps))}.
@@ -123,15 +123,14 @@ handle_deps(State, Deps, Update) ->
end, S)
end,
- AllDeps = lists:keymerge(2
- ,rebar_state:src_apps(State2)
- ,Solved),
+ AllDeps = lists:keymerge(2, lists:keymerge(2
+ ,rebar_state:src_apps(State2)
+ ,Solved), SrcDeps),
%% Sort all apps to build order
State3 = rebar_state:set(State2, all_deps, AllDeps),
{ok, State3}.
-
%% ===================================================================
%% Internal functions
%% ===================================================================
diff --git a/src/rebar_topo.erl b/src/rebar_topo.erl
index 5f528af..9ab4c28 100644
--- a/src/rebar_topo.erl
+++ b/src/rebar_topo.erl
@@ -103,7 +103,7 @@ apps_to_pairs(Apps) ->
-spec app_to_pairs(rebar_app_info:t()) -> [pair()].
app_to_pairs(App) ->
- [{DepApp, rebar_app_info:name(App)} ||
+ [{ec_cnv:to_binary(DepApp), rebar_app_info:name(App)} ||
DepApp <-
rebar_app_info:deps(App)].