summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar_opts.erl40
-rw-r--r--src/rebar_prv_compile.erl13
-rw-r--r--src/rebar_prv_install_deps.erl9
3 files changed, 53 insertions, 9 deletions
diff --git a/src/rebar_opts.erl b/src/rebar_opts.erl
index b7156b2..1a927ba 100644
--- a/src/rebar_opts.erl
+++ b/src/rebar_opts.erl
@@ -35,12 +35,40 @@ erl_opts(Opts) ->
Defines = [{d, list_to_atom(D)} ||
D <- ?MODULE:get(Opts, defines, [])],
AllOpts = Defines ++ RawErlOpts,
- case proplists:is_defined(no_debug_info, AllOpts) of
- true ->
- [O || O <- AllOpts, O =/= no_debug_info];
- false ->
- [debug_info|AllOpts]
- end.
+ lists:reverse(filter_debug_info(lists:reverse(AllOpts))).
+
+filter_debug_info([]) ->
+ %% Default == ON
+ [debug_info];
+filter_debug_info([debug_info|_] = L) ->
+ %% drop no_debug_info and {debug_info_key, _} since those would
+ %% conflict with a plain debug_info
+ [debug_info |
+ lists:filter(fun(K) ->
+ K =/= no_debug_info andalso K =/= debug_info andalso
+ not (is_tuple(K) andalso element(1,K) =:= debug_info_key)
+ end, L)];
+filter_debug_info([{debug_info, _} = H | T]) ->
+ %% custom debug_info field; keep and filter the rest except
+ %% without no_debug_info. Still have to filter for regular or crypto
+ %% debug_info.
+ [H | filter_debug_info(lists:filter(fun(K) -> K =/= no_debug_info end, T))];
+filter_debug_info([{debug_info_key, _}=H | T]) ->
+ %% Drop no_debug_info and regular debug_info
+ [H | lists:filter(fun(K) ->
+ K =/= no_debug_info andalso K =/= debug_info andalso
+ not (is_tuple(K) andalso element(1,K) =:= debug_info_key)
+ end, T)];
+filter_debug_info([no_debug_info|T]) ->
+ %% Drop all debug info
+ lists:filter(fun(debug_info) -> false
+ ; ({debug_info, _}) -> false
+ ; ({debug_info_key, _}) -> false
+ ; (no_debug_info) -> false
+ ; (_Other) -> true
+ end, T);
+filter_debug_info([H|T]) ->
+ [H|filter_debug_info(T)].
apply_overrides(Opts, Name, Overrides) ->
%% Inefficient. We want the order we get here though.
diff --git a/src/rebar_prv_compile.erl b/src/rebar_prv_compile.erl
index c9a77a5..72320fb 100644
--- a/src/rebar_prv_compile.erl
+++ b/src/rebar_prv_compile.erl
@@ -136,7 +136,18 @@ compile(State, Providers, AppInfo) ->
AppInfo3 = rebar_hooks:run_all_hooks(AppDir, post, ?ERLC_HOOK, Providers, AppInfo2, State),
AppInfo4 = rebar_hooks:run_all_hooks(AppDir, pre, ?APP_HOOK, Providers, AppInfo3, State),
- case rebar_otp_app:compile(State, AppInfo4) of
+
+ %% Load plugins back for make_vsn calls in custom resources.
+ %% The rebar_otp_app compilation step is safe regarding the
+ %% overall path management, so we can just load all plugins back
+ %% in memory.
+ PluginDepsPaths = rebar_state:code_paths(State, all_plugin_deps),
+ code:add_pathsa(PluginDepsPaths),
+ AppFileCompileResult = rebar_otp_app:compile(State, AppInfo4),
+ %% Clean up after ourselves, leave things as they were.
+ rebar_utils:remove_from_code_path(PluginDepsPaths),
+
+ case AppFileCompileResult of
{ok, AppInfo5} ->
AppInfo6 = rebar_hooks:run_all_hooks(AppDir, post, ?APP_HOOK, Providers, AppInfo5, State),
AppInfo7 = rebar_hooks:run_all_hooks(AppDir, post, ?PROVIDER, Providers, AppInfo6, State),
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl
index 65aabff..b735ed0 100644
--- a/src/rebar_prv_install_deps.erl
+++ b/src/rebar_prv_install_deps.erl
@@ -419,8 +419,13 @@ warn_skip_deps(AppInfo, State) ->
Args = [rebar_app_info:name(AppInfo),
rebar_app_info:source(AppInfo)],
case rebar_state:get(State, deps_error_on_conflict, false) of
- false -> ?WARN(Msg, Args);
- true -> ?ERROR(Msg, Args), ?FAIL
+ false ->
+ case rebar_state:get(State, deps_warning_on_conflict, true) of
+ true -> ?WARN(Msg, Args);
+ false -> ok
+ end;
+ true ->
+ ?ERROR(Msg, Args), ?FAIL
end.
not_needs_compile(App) ->