Re-use rebar_utils:ebin_dir()

This commit is contained in:
Tuncer Ayaz 2012-08-06 19:00:18 +02:00
parent e2492eb37f
commit 491d52298e
4 changed files with 4 additions and 10 deletions

View file

@ -87,12 +87,9 @@ setup_code_path() ->
%% and the like can work properly when generating their own %% and the like can work properly when generating their own
%% documentation. %% documentation.
CodePath = code:get_path(), CodePath = code:get_path(),
true = code:add_patha(ebin_dir()), true = code:add_patha(rebar_utils:ebin_dir()),
CodePath. CodePath.
ebin_dir() ->
filename:join(rebar_utils:get_cwd(), "ebin").
newer_file_exists(Paths, LastMod) -> newer_file_exists(Paths, LastMod) ->
CheckFile = fun(Filename, _) -> CheckFile = fun(Filename, _) ->
FLast = filelib:last_modified(Filename), FLast = filelib:last_modified(Filename),

View file

@ -83,7 +83,7 @@
compile(Config, _AppFile) -> compile(Config, _AppFile) ->
DtlOpts = erlydtl_opts(Config), DtlOpts = erlydtl_opts(Config),
OrigPath = code:get_path(), OrigPath = code:get_path(),
true = code:add_path(filename:join(rebar_utils:get_cwd(), "ebin")), true = code:add_path(rebar_utils:ebin_dir()),
Result = rebar_base_compiler:run(Config, [], Result = rebar_base_compiler:run(Config, [],
option(doc_root, DtlOpts), option(doc_root, DtlOpts),
option(source_ext, DtlOpts), option(source_ext, DtlOpts),

View file

@ -38,7 +38,7 @@ shell(_Config, _AppFile) ->
%% for the "top level" directory %% for the "top level" directory
case is_deps_dir(rebar_utils:get_cwd()) of case is_deps_dir(rebar_utils:get_cwd()) of
false -> false ->
true = code:add_pathz(ebin_dir()), true = code:add_pathz(rebar_utils:ebin_dir()),
user_drv:start(), user_drv:start(),
%% this call never returns (until user quits shell) %% this call never returns (until user quits shell)
shell:server(false, false); shell:server(false, false);
@ -47,9 +47,6 @@ shell(_Config, _AppFile) ->
end, end,
ok. ok.
ebin_dir() ->
filename:join(rebar_utils:get_cwd(), "ebin").
is_deps_dir(Dir) -> is_deps_dir(Dir) ->
case lists:reverse(filename:split(Dir)) of case lists:reverse(filename:split(Dir)) of
[_, "deps" | _] -> [_, "deps" | _] ->

View file

@ -53,7 +53,7 @@ xref(Config, _) ->
%% Save the code path prior to doing anything %% Save the code path prior to doing anything
OrigPath = code:get_path(), OrigPath = code:get_path(),
true = code:add_path(filename:join(rebar_utils:get_cwd(), "ebin")), true = code:add_path(rebar_utils:ebin_dir()),
%% Get list of xref checks we want to run %% Get list of xref checks we want to run
XrefChecks = rebar_config:get(Config, xref_checks, XrefChecks = rebar_config:get(Config, xref_checks,