summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2016-01-10 10:45:51 -0600
committerTristan Sloughter <t@crashfast.com>2016-01-10 11:18:21 -0600
commitfe7b4aa3ed62fdf411a9f61f55536419e2c5bdbe (patch)
treec4771958935f691b35ddbd28400de8724cb62224 /src
parent414dd344e96ac4cb430c3e055b26ac73a6a988b0 (diff)
merge overlay entries into a single {overlay, list()} for relx
Diffstat (limited to 'src')
-rw-r--r--src/rebar_relx.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rebar_relx.erl b/src/rebar_relx.erl
index cb8fac5..5d29258 100644
--- a/src/rebar_relx.erl
+++ b/src/rebar_relx.erl
@@ -30,8 +30,9 @@ do(Module, Command, Provider, State) ->
relx:main([{lib_dirs, LibDirs}
,{caller, api} | output_dir(OutputDir, Options)], AllOptions);
Config ->
+ Config1 = merge_overlays(Config),
relx:main([{lib_dirs, LibDirs}
- ,{config, Config}
+ ,{config, Config1}
,{caller, api} | output_dir(OutputDir, Options)], AllOptions)
end,
rebar_hooks:run_all_hooks(Cwd, post, Provider, Providers, State),
@@ -49,3 +50,12 @@ format_error(Reason) ->
output_dir(OutputDir, Options) ->
[{output_dir, OutputDir} || not(lists:member("-o", Options))
andalso not(lists:member("--output-dir", Options))].
+
+merge_overlays(Config) ->
+ {Overlays, Others} =
+ lists:partition(fun(C) when element(1, C) =:= overlay -> true;
+ (_) -> false
+ end, Config),
+ %% Have profile overlay entries come before others to match how profiles work elsewhere
+ NewOverlay = lists:reverse(lists:flatmap(fun({overlay, Overlay}) -> Overlay end, Overlays)),
+ [{overlay, NewOverlay} | Others].