mirror of
https://github.com/correl/rebar.git
synced 2024-11-27 11:09:55 +00:00
parent
df42410cf2
commit
298743d50e
6 changed files with 44 additions and 11 deletions
7
inttest/depplugins/base_dir_cwd_plugin.erl
Normal file
7
inttest/depplugins/base_dir_cwd_plugin.erl
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
-module(base_dir_cwd_plugin).
|
||||||
|
-export([pre_compile/2]).
|
||||||
|
|
||||||
|
pre_compile(_, _) ->
|
||||||
|
File = "base_dir_cwd_pre.compile",
|
||||||
|
ok = file:write_file(File, <<"base_dir cwd pre_compile plugin">>),
|
||||||
|
rebar_log:log(info, "Wrote ~p/~s~n", [rebar_utils:get_cwd(), File]).
|
7
inttest/depplugins/dep_cwd_plugin.erl
Normal file
7
inttest/depplugins/dep_cwd_plugin.erl
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
-module(dep_cwd_plugin).
|
||||||
|
-export([pre_compile/2]).
|
||||||
|
|
||||||
|
pre_compile(_, _) ->
|
||||||
|
File = "dep_cwd_pre.compile",
|
||||||
|
ok = file:write_file(File, <<"dep cwd pre_compile plugin">>),
|
||||||
|
rebar_log:log(info, "Wrote ~p/~s~n", [rebar_utils:get_cwd(), File]).
|
|
@ -20,21 +20,37 @@ files() ->
|
||||||
[
|
[
|
||||||
{copy, "../../rebar", "rebar"},
|
{copy, "../../rebar", "rebar"},
|
||||||
{copy, "rebar.config", "rebar.config"},
|
{copy, "rebar.config", "rebar.config"},
|
||||||
|
{copy, "base_dir_cwd_plugin.erl", "base_dir_cwd_plugin.erl"},
|
||||||
{create, "ebin/fish.app", app(fish, [])},
|
{create, "ebin/fish.app", app(fish, [])},
|
||||||
|
|
||||||
{create, "deps/dependsonplugin/ebin/dependsonplugin.app",
|
|
||||||
app(dependsonplugin, [])},
|
|
||||||
{copy, "rebar_dependsonplugin.config",
|
{copy, "rebar_dependsonplugin.config",
|
||||||
"deps/dependsonplugin/rebar.config"},
|
"deps/dependsonplugin/rebar.config"},
|
||||||
|
{create, "deps/dependsonplugin/ebin/dependsonplugin.app",
|
||||||
|
app(dependsonplugin, [])},
|
||||||
|
|
||||||
|
{copy, "rebar_testplugin.config", "deps/testplugin/rebar.config"},
|
||||||
{copy, "testplugin_mod.erl",
|
{copy, "testplugin_mod.erl",
|
||||||
"deps/testplugin/plugins/testplugin_mod.erl"},
|
"deps/testplugin/plugins/testplugin_mod.erl"},
|
||||||
{create, "deps/testplugin/ebin/testplugin.app",
|
{copy, "dep_cwd_plugin.erl", "deps/testplugin/dep_cwd_plugin.erl"},
|
||||||
app(testplugin, [])}
|
{create, "deps/testplugin/ebin/testplugin.app", app(testplugin, [])}
|
||||||
].
|
].
|
||||||
|
|
||||||
run(_Dir) ->
|
run(_Dir) ->
|
||||||
?assertMatch({ok, _}, retest_sh:run("./rebar compile", [])),
|
?assertMatch({ok, _}, retest_sh:run("./rebar compile", [])),
|
||||||
?assertEqual(true, filelib:is_regular("deps/dependsonplugin/pre.compile")),
|
|
||||||
|
?assertEqual(true, filelib:is_regular("base_dir_cwd_pre.compile")),
|
||||||
|
|
||||||
|
?assertEqual(true, filelib:is_regular(
|
||||||
|
"deps/dependsonplugin/base_dir_cwd_pre.compile")),
|
||||||
|
?assertEqual(true, filelib:is_regular(
|
||||||
|
"deps/dependsonplugin/plugin_pre.compile")),
|
||||||
|
|
||||||
|
?assertEqual(true, filelib:is_regular(
|
||||||
|
"deps/testplugin/base_dir_cwd_pre.compile")),
|
||||||
|
?assertEqual(true, filelib:is_regular(
|
||||||
|
"deps/testplugin/dep_cwd_pre.compile")),
|
||||||
|
?assertEqual(true, filelib:is_regular(
|
||||||
|
"deps/testplugin/plugin_pre.compile")),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
{deps, [dependsonplugin]}.
|
{deps, [dependsonplugin]}.
|
||||||
|
{plugins, [base_dir_cwd_plugin]}.
|
||||||
|
|
1
inttest/depplugins/rebar_testplugin.config
Normal file
1
inttest/depplugins/rebar_testplugin.config
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{plugins, [dep_cwd_plugin]}.
|
|
@ -1,6 +1,7 @@
|
||||||
-module(testplugin_mod).
|
-module(testplugin_mod).
|
||||||
-compile(export_all).
|
-export([pre_compile/2]).
|
||||||
|
|
||||||
pre_compile(Config, _) ->
|
pre_compile(_, _) ->
|
||||||
ok = file:write_file("pre.compile", <<"Yadda!">>),
|
File = "plugin_pre.compile",
|
||||||
rebar_log:log(info, "Wrote ~p/pre.compile~n", [rebar_utils:get_cwd()]).
|
ok = file:write_file(File, <<"Yadda!">>),
|
||||||
|
rebar_log:log(info, "Wrote ~p/~s~n", [rebar_utils:get_cwd(), File]).
|
||||||
|
|
Loading…
Reference in a new issue