|
@ -105,7 +105,7 @@ |
|
|
|
|
|
|
|
|
-include("rebar.hrl"). |
|
|
-include("rebar.hrl"). |
|
|
|
|
|
|
|
|
-define(PROVIDER, erlydtl). |
|
|
|
|
|
|
|
|
-define(PROVIDER, compile). |
|
|
-define(DEPS, []). |
|
|
-define(DEPS, []). |
|
|
|
|
|
|
|
|
%% =================================================================== |
|
|
%% =================================================================== |
|
@ -116,9 +116,10 @@ |
|
|
init(State) -> |
|
|
init(State) -> |
|
|
State1 = rebar_state:add_provider(State, providers:create([{name, ?PROVIDER}, |
|
|
State1 = rebar_state:add_provider(State, providers:create([{name, ?PROVIDER}, |
|
|
{module, ?MODULE}, |
|
|
{module, ?MODULE}, |
|
|
|
|
|
{namespace, erlydtl}, |
|
|
{bare, false}, |
|
|
{bare, false}, |
|
|
{deps, ?DEPS}, |
|
|
{deps, ?DEPS}, |
|
|
{example, "rebar erlydtl compile"}, |
|
|
|
|
|
|
|
|
{example, "rebar3 erlydtl compile"}, |
|
|
{short_desc, "Compile erlydtl templates."}, |
|
|
{short_desc, "Compile erlydtl templates."}, |
|
|
{desc, ""}, |
|
|
{desc, ""}, |
|
|
{opts, []}])), |
|
|
{opts, []}])), |
|
@ -126,8 +127,6 @@ init(State) -> |
|
|
|
|
|
|
|
|
do(Config) -> |
|
|
do(Config) -> |
|
|
MultiDtlOpts = erlydtl_opts(Config), |
|
|
MultiDtlOpts = erlydtl_opts(Config), |
|
|
OrigPath = code:get_path(), |
|
|
|
|
|
%true = code:add_path(rebar_utils:ebin_dir()), |
|
|
|
|
|
|
|
|
|
|
|
Result = lists:foldl(fun(DtlOpts, _) -> |
|
|
Result = lists:foldl(fun(DtlOpts, _) -> |
|
|
file:make_dir(option(out_dir, DtlOpts)), |
|
|
file:make_dir(option(out_dir, DtlOpts)), |
|
@ -143,7 +142,6 @@ do(Config) -> |
|
|
{recursive, option(recursive, DtlOpts)}]) |
|
|
{recursive, option(recursive, DtlOpts)}]) |
|
|
end, ok, MultiDtlOpts), |
|
|
end, ok, MultiDtlOpts), |
|
|
|
|
|
|
|
|
true = code:set_path(OrigPath), |
|
|
|
|
|
{Result, Config}. |
|
|
{Result, Config}. |
|
|
|
|
|
|
|
|
-spec format_error(any()) -> iolist(). |
|
|
-spec format_error(any()) -> iolist(). |
|
|