瀏覽代碼

include applications list in compile sort

pull/340/head
Tristan Sloughter 10 年之前
父節點
當前提交
f82874de58
共有 5 個檔案被更改,包括 15 行新增6 行删除
  1. +1
    -1
      rebar.config
  2. +6
    -1
      src/rebar_app_discover.erl
  3. +0
    -1
      src/rebar_app_utils.erl
  4. +5
    -1
      src/rebar_digraph.erl
  5. +3
    -2
      src/rebar_prv_compile.erl

+ 1
- 1
rebar.config 查看文件

@ -9,7 +9,7 @@
[getopt, merl, erlydtl, erlware_commons, relx, providers, rebar]}.
{escript_top_level_app, rebar}.
{escript_name, rebar3}.
{escript_emu_args, "%%! +sbtu +A0 -noinput\n"}.
{escript_emu_args, "%%! +sbtu +A0\n"}.
{erl_opts,
[{platform_define, "R14", no_callback_support},

+ 6
- 1
src/rebar_app_discover.erl 查看文件

@ -164,7 +164,12 @@ create_app_info(AppDir, AppFile) ->
AppInfo1 = rebar_app_info:applications(
rebar_app_info:app_details(AppInfo, AppDetails),
IncludedApplications++Applications),
Valid = rebar_app_utils:validate_application_info(AppInfo1),
Valid = case rebar_app_utils:validate_application_info(AppInfo1) of
true ->
true;
_ ->
false
end,
rebar_app_info:dir(rebar_app_info:valid(AppInfo1, Valid), AppDir);
_ ->
error

+ 0
- 1
src/rebar_app_utils.erl 查看文件

@ -77,7 +77,6 @@ validate_application_info(AppInfo, AppDetail) ->
?PRV_ERROR({module_list, AppFile});
List ->
has_all_beams(EbinDir, List)
end
end.

+ 5
- 1
src/rebar_digraph.erl 查看文件

@ -13,7 +13,7 @@ compile_order(Apps) ->
Graph = digraph:new(),
lists:foreach(fun(App) ->
Name = rebar_app_info:name(App),
Deps = rebar_app_info:deps(App),
Deps = all_apps_deps(App),
add(Graph, {Name, Deps})
end, Apps),
case digraph_utils:topsort(Graph) of
@ -123,3 +123,7 @@ find_app_by_name(Name, Apps) ->
ec_lists:find(fun(App) ->
rebar_app_info:name(App) =:= Name
end, Apps).
all_apps_deps(App) ->
Applications = [atom_to_binary(X, utf8) || X <- rebar_app_info:applications(App)],
lists:usort(rebar_app_info:deps(App) ++ Applications).

+ 3
- 2
src/rebar_prv_compile.erl 查看文件

@ -46,11 +46,12 @@ do(State) ->
%% Use the project State for building project apps
%% Set hooks to empty so top-level hooks aren't run for each project app
State2 = rebar_state:set(rebar_state:set(State, post_hooks, []), pre_hooks, []),
ProjectApps1 = build_apps(State2, Providers, ProjectApps),
{ok, ProjectApps1} = rebar_digraph:compile_order(ProjectApps),
ProjectApps2 = build_apps(State2, Providers, ProjectApps1),
rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, State),
{ok, rebar_state:project_apps(State, ProjectApps1)}.
{ok, rebar_state:project_apps(State, ProjectApps2)}.
-spec format_error(any()) -> iolist().
format_error(Reason) ->

Loading…
取消
儲存