summaryrefslogtreecommitdiff
path: root/inttest/tplugins/test_plugin.erl
diff options
context:
space:
mode:
authorTim Watson <watson.timothy@gmail.com>2011-05-03 00:15:19 +0100
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2011-08-29 17:27:45 +0200
commit3b58935b8621a876afad2f649bbd00a12f7ab03f (patch)
treee7d90f6d318e8d52f9db40635c4bd22f40b1e9a5 /inttest/tplugins/test_plugin.erl
parent7a1c88228be2129ad517d5b4eda9c4c9232115bf (diff)
Load plugins dynamically from source
This patch updates rebar_core to look for missing plugins (i.e. those that aren't found on the code path at runtime) in a configurable plugin directory, and dynamically compile and load them at runtime. By default, the directory "plugins" is searched, although this can be overriden by setting the plugin_dir in your rebar.config.
Diffstat (limited to 'inttest/tplugins/test_plugin.erl')
-rw-r--r--inttest/tplugins/test_plugin.erl8
1 files changed, 8 insertions, 0 deletions
diff --git a/inttest/tplugins/test_plugin.erl b/inttest/tplugins/test_plugin.erl
new file mode 100644
index 0000000..461247c
--- /dev/null
+++ b/inttest/tplugins/test_plugin.erl
@@ -0,0 +1,8 @@
+-module(test_plugin).
+-compile(export_all).
+
+fwibble(Config, _) ->
+ Pwd = rebar_utils:get_cwd(),
+ Ok = filelib:is_regular(filename:join(Pwd, "fwibble.test")),
+ rebar_log:log(info, "~p:~p in ~s :: ~p~n", [test_plugin, clean, Pwd, Ok]),
+ ok = file:delete("fwibble.test").