diff options
-rw-r--r-- | rebar.config | 2 | ||||
-rw-r--r-- | src/rebar_app_discover.erl | 7 | ||||
-rw-r--r-- | src/rebar_app_utils.erl | 1 | ||||
-rw-r--r-- | src/rebar_digraph.erl | 6 | ||||
-rw-r--r-- | src/rebar_prv_compile.erl | 5 |
5 files changed, 15 insertions, 6 deletions
diff --git a/rebar.config b/rebar.config index 8d64b5d..36ce9a4 100644 --- a/rebar.config +++ b/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}, diff --git a/src/rebar_app_discover.erl b/src/rebar_app_discover.erl index fe930bd..16dcf24 100644 --- a/src/rebar_app_discover.erl +++ b/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 diff --git a/src/rebar_app_utils.erl b/src/rebar_app_utils.erl index 143d73d..3da00be 100644 --- a/src/rebar_app_utils.erl +++ b/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. diff --git a/src/rebar_digraph.erl b/src/rebar_digraph.erl index 7c1fe90..9e10d49 100644 --- a/src/rebar_digraph.erl +++ b/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). diff --git a/src/rebar_prv_compile.erl b/src/rebar_prv_compile.erl index a440927..11a01ed 100644 --- a/src/rebar_prv_compile.erl +++ b/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) -> |