From 93128f2f6b33ce8e613baa686e9f424cfde01f7e Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Fri, 26 Aug 2011 18:29:09 +0200 Subject: Search plugin sources in base_dir and plugin_dir --- src/rebar_core.erl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/rebar_core.erl') diff --git a/src/rebar_core.erl b/src/rebar_core.erl index 5e7848f..27d9223 100644 --- a/src/rebar_core.erl +++ b/src/rebar_core.erl @@ -407,10 +407,14 @@ load_plugin_modules(Config, Modules) -> Dir end, - %% Find relevant sources + %% Find relevant sources in base_dir and plugin_dir Erls = string:join([atom_to_list(M)++"\\.erl" || M <- Modules], "|"), - RE = ".*" ++ Erls ++ "\$", - Sources = rebar_utils:find_files(PluginDir, RE), + RE = "^" ++ Erls ++ "\$", + BaseDir = rebar_config:get_global(base_dir, []), + %% If a plugin is found in base_dir and plugin_dir the clash + %% will provoke an error and we'll abort. + Sources = rebar_utils:find_files(PluginDir, RE, false) + ++ rebar_utils:find_files(BaseDir, RE, false), %% Compile and load plugins Loaded = [load_plugin(Src) || Src <- Sources], -- cgit v1.1