|
@ -12,7 +12,7 @@ |
|
|
-include("rebar.hrl"). |
|
|
-include("rebar.hrl"). |
|
|
|
|
|
|
|
|
-define(PROVIDER, tar). |
|
|
-define(PROVIDER, tar). |
|
|
-define(DEPS, [compile]). |
|
|
|
|
|
|
|
|
-define(DEPS, [release]). |
|
|
|
|
|
|
|
|
%% =================================================================== |
|
|
%% =================================================================== |
|
|
%% Public API |
|
|
%% Public API |
|
@ -32,14 +32,13 @@ init(State) -> |
|
|
|
|
|
|
|
|
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. |
|
|
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. |
|
|
do(State) -> |
|
|
do(State) -> |
|
|
Caller = rebar_state:get(State, caller, api), |
|
|
|
|
|
Options = rebar_state:command_args(State), |
|
|
Options = rebar_state:command_args(State), |
|
|
DepsDir = rebar_dir:deps_dir(State), |
|
|
DepsDir = rebar_dir:deps_dir(State), |
|
|
ProjectAppDirs = lists:delete(".", ?DEFAULT_PROJECT_APP_DIRS), |
|
|
ProjectAppDirs = lists:delete(".", ?DEFAULT_PROJECT_APP_DIRS), |
|
|
LibDirs = rebar_utils:filtermap(fun ec_file:exists/1, |
|
|
LibDirs = rebar_utils:filtermap(fun ec_file:exists/1, |
|
|
[?DEFAULT_CHECKOUTS_DIR, DepsDir | ProjectAppDirs]), |
|
|
[?DEFAULT_CHECKOUTS_DIR, DepsDir | ProjectAppDirs]), |
|
|
OutputDir = filename:join(rebar_dir:base_dir(State), ?DEFAULT_RELEASE_DIR), |
|
|
OutputDir = filename:join(rebar_dir:base_dir(State), ?DEFAULT_RELEASE_DIR), |
|
|
AllOptions = string:join(["release", "tar" | Options], " "), |
|
|
|
|
|
|
|
|
AllOptions = string:join(["tar" | Options], " "), |
|
|
Cwd = rebar_state:dir(State), |
|
|
Cwd = rebar_state:dir(State), |
|
|
Providers = rebar_state:providers(State), |
|
|
Providers = rebar_state:providers(State), |
|
|
rebar_hooks:run_all_hooks(Cwd, pre, ?PROVIDER, Providers, State), |
|
|
rebar_hooks:run_all_hooks(Cwd, pre, ?PROVIDER, Providers, State), |
|
@ -47,12 +46,12 @@ do(State) -> |
|
|
[] -> |
|
|
[] -> |
|
|
relx:main([{lib_dirs, LibDirs} |
|
|
relx:main([{lib_dirs, LibDirs} |
|
|
,{output_dir, OutputDir} |
|
|
,{output_dir, OutputDir} |
|
|
,{caller, Caller}], AllOptions); |
|
|
|
|
|
|
|
|
,{caller, api}], AllOptions); |
|
|
Config -> |
|
|
Config -> |
|
|
relx:main([{lib_dirs, LibDirs} |
|
|
relx:main([{lib_dirs, LibDirs} |
|
|
,{config, lists:reverse(Config)} |
|
|
,{config, lists:reverse(Config)} |
|
|
,{output_dir, OutputDir} |
|
|
,{output_dir, OutputDir} |
|
|
,{caller, Caller}], AllOptions) |
|
|
|
|
|
|
|
|
,{caller, api}], AllOptions) |
|
|
end, |
|
|
end, |
|
|
rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, State), |
|
|
rebar_hooks:run_all_hooks(Cwd, post, ?PROVIDER, Providers, State), |
|
|
{ok, State}. |
|
|
{ok, State}. |
|
|