Browse Source

Make sure to add ebin/ to current path when compiling doterl files; found by @sj_mackenzie

pull/3/head
Dave Smith 15 years ago
parent
commit
b0dfd233ae
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      src/rebar_erlc_compiler.erl

+ 8
- 2
src/rebar_erlc_compiler.erl View File

@ -56,7 +56,7 @@ clean(_Config, _AppFile) ->
%% directory structure in ebin with .beam files within. As such, we want %% 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 %% to scan whatever is left in the ebin/ directory for sub-dirs which
%% satisfy our criteria. %% satisfy our criteria.
BeamFiles = rebar_utils:find_files("ebin", "^.*\\.beam$"),
BeamFiles = rebar_utils:find_files("ebin", "^.*\\.beam\$"),
rebar_file_utils:delete_each(BeamFiles), rebar_file_utils:delete_each(BeamFiles),
lists:foreach(fun(Dir) -> delete_dir(Dir, dirs(Dir)) end, dirs("ebin")), lists:foreach(fun(Dir) -> delete_dir(Dir, dirs(Dir)) end, dirs("ebin")),
ok. ok.
@ -79,8 +79,14 @@ doterl_compile(Config, OutDir, MoreSources) ->
SrcDirs = src_dirs(proplists:append_values(src_dirs, ErlOpts)), SrcDirs = src_dirs(proplists:append_values(src_dirs, ErlOpts)),
RestErls = [Source || Source <- gather_src(SrcDirs, []) ++ MoreSources, RestErls = [Source || Source <- gather_src(SrcDirs, []) ++ MoreSources,
lists:member(Source, FirstErls) == false], 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, 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.
%% =================================================================== %% ===================================================================

Loading…
Cancel
Save