Current section
Files
Jump to
Current section
Files
src/rebar3_lfe_prv_clean_all.erl
-module(rebar3_lfe_prv_clean_all).
-export([init/1,
do/1,
format_error/1]).
-include("rebar3_lfe.hrl").
-define(PROVIDER, 'clean-all').
-define(DEPS, [{default, clean}]).
%% =============================================================================
%% Plugin API
%% =============================================================================
init(State) ->
Description = "Execute all clean commands",
Provider = providers:create([
{namespace, ?NAMESPACE},
{name, ?PROVIDER},
{module, ?MODULE},
{bare, true},
{deps, ?DEPS},
{example, "rebar3 lfe clean-all"},
{opts, []},
{short_desc, Description},
{desc, info(Description)}
]),
{ok, rebar_state:add_provider(State, Provider)}.
do(State) ->
rebar_paths:set_paths([deps, plugins], State),
rebar3_lfe_clean:all(State),
{ok, State}.
format_error(Reason) ->
io_lib:format("~p", [Reason]).
%% =============================================================================
%% Internal functions
%% =============================================================================
info(Description) ->
io_lib:format(
"~n~s~n"
"~n"
"This deletes the _build directory, all project and plugin caches,~n"
"as well as the rebar.lock and any crashdump files.~n",
[Description]).