From d1409d0b3b2f7fe5c491f866ef983dd7df7d0f42 Mon Sep 17 00:00:00 2001 From: alisdair sullivan Date: Thu, 15 Oct 2015 23:32:43 -0700 Subject: refactor `rebar_erlc_compiler` * modify compiler interface to work on either application objects or directories containing source files * compile all sources in `src_dirs` to the application `ebin` dir and all sources in `extra_src_dirs` to a directory mirroring it's position in the app's `_build` directory. for example, `apps/foo/more` would compile to `_build/default/lib/foo/more` for `extra_src_dirs` in the root of a project with multiple applications (so orphan directories that don't "belong" to an application) compile to `_build/default/extras/more` * copy directories specified in `extra_src_dirs` into the `_build` directory so tools like `ct` and `xref` that expect source to be in a particular location still work * clean compiled artifacts from all `extra_src_dirs` * alter `eunit`, `ct` and `cover` to work with the new directory structure * billions of new tests --- src/rebar_utils.erl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/rebar_utils.erl') diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index ccdf960..4fd4bd1 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -65,7 +65,8 @@ escape_double_quotes_weak/1, check_min_otp_version/1, check_blacklisted_otp_versions/1, - info_useless/2]). + info_useless/2, + list_dir/1]). %% for internal use only -export([otp_release/0]). @@ -774,3 +775,9 @@ info_useless(Old, New) -> || Name <- Old, not lists:member(Name, New)], ok. + +-ifdef(no_list_dir_all). +list_dir(Dir) -> file:list_dir(Dir). +-else. +list_dir(Dir) -> file:list_dir_all(Dir). +-endif. -- cgit v1.1