summaryrefslogtreecommitdiff
path: root/src/rebar_erlc_compiler.erl
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2010-02-16 15:16:19 -0700
committerDave Smith <dizzyd@dizzyd.com>2010-02-16 15:16:19 -0700
commitb0dfd233ae6b53782914f48366b4438842cb2d21 (patch)
tree520a296e97e50ee4c4a8881ab3aa1abea16bcc1f /src/rebar_erlc_compiler.erl
parent6714d47efb96a7717bfedefb722ff0fa3e2e6a75 (diff)
Make sure to add ebin/ to current path when compiling doterl files; found by @sj_mackenzie
Diffstat (limited to 'src/rebar_erlc_compiler.erl')
-rw-r--r--src/rebar_erlc_compiler.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index c41b96d..2065a60 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -56,7 +56,7 @@ clean(_Config, _AppFile) ->
%% directory structure in ebin with .beam files within. As such, we want
%% to scan whatever is left in the ebin/ directory for sub-dirs which
%% satisfy our criteria.
- BeamFiles = rebar_utils:find_files("ebin", "^.*\\.beam$"),
+ BeamFiles = rebar_utils:find_files("ebin", "^.*\\.beam\$"),
rebar_file_utils:delete_each(BeamFiles),
lists:foreach(fun(Dir) -> delete_dir(Dir, dirs(Dir)) end, dirs("ebin")),
ok.
@@ -79,8 +79,14 @@ doterl_compile(Config, OutDir, MoreSources) ->
SrcDirs = src_dirs(proplists:append_values(src_dirs, ErlOpts)),
RestErls = [Source || Source <- gather_src(SrcDirs, []) ++ MoreSources,
lists:member(Source, FirstErls) == false],
+
+ %% Make sure that ebin/ is on the path
+ CurrPath = code:get_path(),
+ code:add_path("ebin"),
rebar_base_compiler:run(Config, FirstErls, RestErls,
- fun(S, C) -> internal_erl_compile(S, C, OutDir) end).
+ fun(S, C) -> internal_erl_compile(S, C, OutDir) end),
+ code:set_path(CurrPath),
+ ok.
%% ===================================================================