浏览代码

fix compilation order

pull/3/head
Tristan Sloughter 10 年前
父节点
当前提交
3f9ff5a302
共有 3 个文件被更改,包括 18 次插入14 次删除
  1. +13
    -8
      src/rebar_app_discover.erl
  2. +4
    -5
      src/rebar_prv_install_deps.erl
  3. +1
    -1
      src/rebar_topo.erl

+ 13
- 8
src/rebar_app_discover.erl 查看文件

@ -110,8 +110,9 @@ create_app_info(AppDir, AppFile) ->
case file:consult(AppFile) of case file:consult(AppFile) of
{ok, [{application, AppName, AppDetails}]} -> {ok, [{application, AppName, AppDetails}]} ->
AppVsn = proplists:get_value(vsn, AppDetails), AppVsn = proplists:get_value(vsn, AppDetails),
AppDeps = proplists:get_value(applications, AppDetails, []),
AbsCwd = filename:absname(rebar_utils:get_cwd()), 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"), RebarConfig = filename:join(AppDir, "rebar.config"),
AppState = case filelib:is_file(RebarConfig) of AppState = case filelib:is_file(RebarConfig) of
true -> true ->
@ -131,13 +132,17 @@ create_app_info(AppDir, AppFile) ->
-spec validate_application_info(rebar_app_info:t()) -> boolean(). -spec validate_application_info(rebar_app_info:t()) -> boolean().
validate_application_info(AppInfo) -> validate_application_info(AppInfo) ->
EbinDir = rebar_app_info:ebin_dir(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. end.
-spec get_modules_list(file:filename_all(), proplists:proplist()) -> -spec get_modules_list(file:filename_all(), proplists:proplist()) ->

+ 4
- 5
src/rebar_prv_install_deps.erl 查看文件

@ -74,7 +74,7 @@ do(State) ->
handle_deps(State, Locks) handle_deps(State, Locks)
end, end,
Source = ProjectApps ++ rebar_state:src_deps(State1),
Source = ProjectApps ++ rebar_state:get(State1, all_deps),
{ok, Sort} = rebar_topo:sort_apps(Source), {ok, Sort} = rebar_topo:sort_apps(Source),
{ok, rebar_state:set(State1, deps_to_build, lists:dropwhile(fun is_valid/1, Sort -- ProjectApps))}. {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, S)
end, 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 %% Sort all apps to build order
State3 = rebar_state:set(State2, all_deps, AllDeps), State3 = rebar_state:set(State2, all_deps, AllDeps),
{ok, State3}. {ok, State3}.
%% =================================================================== %% ===================================================================
%% Internal functions %% Internal functions
%% =================================================================== %% ===================================================================

+ 1
- 1
src/rebar_topo.erl 查看文件

@ -103,7 +103,7 @@ apps_to_pairs(Apps) ->
-spec app_to_pairs(rebar_app_info:t()) -> [pair()]. -spec app_to_pairs(rebar_app_info:t()) -> [pair()].
app_to_pairs(App) -> app_to_pairs(App) ->
[{DepApp, rebar_app_info:name(App)} ||
[{ec_cnv:to_binary(DepApp), rebar_app_info:name(App)} ||
DepApp <- DepApp <-
rebar_app_info:deps(App)]. rebar_app_info:deps(App)].

正在加载...
取消
保存