summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-02-22 16:02:20 -0500
committerFred Hebert <mononcqc@ferd.ca>2015-02-22 16:02:20 -0500
commit558646adbc044d85aae4d972682d008a9c7554c7 (patch)
treefdc51ad37688f340dec9db3fc0eef5fb039d03af /src
parent280b8af78cd08c3e6029806936cd1637ff140f8b (diff)
parentbf707339811c183e17da661800174c2173a17b05 (diff)
Merge pull request #167 from tsloughter/release_tests
release and tar tests
Diffstat (limited to 'src')
-rw-r--r--src/rebar3.erl11
-rw-r--r--src/rebar_prv_release.erl7
-rw-r--r--src/rebar_prv_tar.erl9
3 files changed, 18 insertions, 9 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl
index e8a9983..bd52fee 100644
--- a/src/rebar3.erl
+++ b/src/rebar3.erl
@@ -76,7 +76,8 @@ main(Args) ->
run(BaseState, Commands) ->
_ = application:load(rebar),
BaseState1 = rebar_state:set(BaseState, task, Commands),
- run_aux(BaseState1, [], Commands).
+ BaseState2 = rebar_state:set(BaseState1, caller, api),
+ run_aux(BaseState2, [], Commands).
%% ====================================================================
%% Internal functions
@@ -84,7 +85,9 @@ run(BaseState, Commands) ->
run(RawArgs) ->
_ = application:load(rebar),
- {GlobalPluginProviders, BaseConfig} = init_config(),
+
+ {GlobalPluginProviders, BaseState} = init_config(),
+ BaseState1 = rebar_state:set(BaseState, caller, command_line),
case erlang:system_info(version) of
"6.1" ->
@@ -94,8 +97,8 @@ run(RawArgs) ->
ok
end,
- {BaseConfig1, _Args1} = set_options(BaseConfig, {[], []}),
- run_aux(BaseConfig1, GlobalPluginProviders, RawArgs).
+ {BaseState2, _Args1} = set_options(BaseState1, {[], []}),
+ run_aux(BaseState2, GlobalPluginProviders, RawArgs).
run_aux(State, GlobalPluginProviders, RawArgs) ->
%% Make sure crypto is running
diff --git a/src/rebar_prv_release.erl b/src/rebar_prv_release.erl
index 29e1dc2..f2098fb 100644
--- a/src/rebar_prv_release.erl
+++ b/src/rebar_prv_release.erl
@@ -32,6 +32,7 @@ init(State) ->
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
do(State) ->
+ Caller = rebar_state:get(State, caller, api),
Options = rebar_state:command_args(State),
DepsDir = rebar_dir:deps_dir(State),
LibDirs = rebar_utils:filtermap(fun ec_file:exists/1,
@@ -42,11 +43,13 @@ do(State) ->
case rebar_state:get(State, relx, []) of
[] ->
relx:main([{lib_dirs, LibDirs}
- ,{output_dir, OutputDir}], AllOptions);
+ ,{output_dir, OutputDir}
+ ,{caller, Caller}], AllOptions);
Config ->
relx:main([{lib_dirs, LibDirs}
,{config, Config}
- ,{output_dir, OutputDir}], AllOptions)
+ ,{output_dir, OutputDir}
+ ,{caller, Caller}], AllOptions)
end,
{ok, State}
catch
diff --git a/src/rebar_prv_tar.erl b/src/rebar_prv_tar.erl
index 7efa544..87ee4df 100644
--- a/src/rebar_prv_tar.erl
+++ b/src/rebar_prv_tar.erl
@@ -32,6 +32,7 @@ init(State) ->
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
do(State) ->
+ Caller = rebar_state:get(State, caller, api),
Options = rebar_state:command_args(State),
DepsDir = rebar_dir:deps_dir(State),
LibDirs = rebar_utils:filtermap(fun ec_file:exists/1,
@@ -40,12 +41,14 @@ do(State) ->
AllOptions = string:join(["release", "tar" | Options], " "),
case rebar_state:get(State, relx, []) of
[] ->
- relx:main([{lib_dirs, LibDirs
- ,{output_dir, OutputDir}}], AllOptions);
+ relx:main([{lib_dirs, LibDirs}
+ ,{output_dir, OutputDir}
+ ,{caller, Caller}], AllOptions);
Config ->
relx:main([{lib_dirs, LibDirs}
,{config, Config}
- ,{output_dir, OutputDir}], AllOptions)
+ ,{output_dir, OutputDir}
+ ,{caller, Caller}], AllOptions)
end,
{ok, State}.