From b9b4e12600999cf2a2da4211508009ac7db96568 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 30 May 2015 21:45:21 -0500 Subject: keep all_deps list in state created for building deps --- src/rebar_prv_compile.erl | 11 +++++++---- src/rebar_prv_escriptize.erl | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/rebar_prv_compile.erl b/src/rebar_prv_compile.erl index 37dc47d..2737827 100644 --- a/src/rebar_prv_compile.erl +++ b/src/rebar_prv_compile.erl @@ -41,10 +41,12 @@ do(State) -> Deps = rebar_state:deps_to_build(State), Cwd = rebar_state:dir(State), - %% Need to allow global config vars used on deps - %% Right now no way to differeniate and just give deps a new state + %% Need to allow global config vars used on deps. + %% Right now no way to differeniate and just give deps a new state. + %% But need an account of "all deps" for some hooks to use. EmptyState = rebar_state:new(), - build_apps(EmptyState, Providers, Deps), + build_apps(rebar_state:all_deps(EmptyState, + rebar_state:all_deps(State)), Providers, Deps), {ok, ProjectApps1} = rebar_digraph:compile_order(ProjectApps), @@ -76,7 +78,8 @@ build_app(State, Providers, AppInfo) -> copy_app_dirs(State, AppDir, OutDir), S = rebar_app_info:state_or_new(State, AppInfo), - compile(S, Providers, AppInfo). + S1 = rebar_state:all_deps(S, rebar_state:all_deps(State)), + compile(S1, Providers, AppInfo). compile(State, Providers, AppInfo) -> ?INFO("Compiling ~s", [rebar_app_info:name(AppInfo)]), diff --git a/src/rebar_prv_escriptize.erl b/src/rebar_prv_escriptize.erl index b58800a..df3a271 100644 --- a/src/rebar_prv_escriptize.erl +++ b/src/rebar_prv_escriptize.erl @@ -72,7 +72,7 @@ do(State) -> end; Name -> AllApps = rebar_state:all_deps(State)++rebar_state:project_apps(State), - AppInfo = rebar_app_utils:find(Name, AllApps), + {ok, AppInfo} = rebar_app_utils:find(ec_cnv:to_binary(Name), AllApps), escriptize(State, AppInfo) end. @@ -83,6 +83,7 @@ escriptize(State0, App) -> %% Get the output filename for the escript -- this may include dirs Filename = filename:join([rebar_dir:base_dir(State0), "bin", rebar_state:get(State0, escript_name, AppName)]), + ?DEBUG("Creating escript file ~s", [Filename]), ok = filelib:ensure_dir(Filename), State = rebar_state:escript_path(State0, Filename), -- cgit v1.1