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 --- test/rebar_test_utils.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/rebar_test_utils.erl') diff --git a/test/rebar_test_utils.erl b/test/rebar_test_utils.erl index ca5e91a..3943db7 100644 --- a/test/rebar_test_utils.erl +++ b/test/rebar_test_utils.erl @@ -334,7 +334,7 @@ check_results(AppDir, Expected, ProfileRun) -> {ok, RelxState3} = rlx_prv_rel_discover:do(RelxState2), LibDir = filename:join([ReleaseDir, Name, "lib"]), - {ok, RelLibs} = file:list_dir(LibDir), + {ok, RelLibs} = rebar_utils:list_dir(LibDir), IsSymLinkFun = fun(X) -> ec_file:is_symlink(filename:join(LibDir, X)) @@ -357,6 +357,9 @@ check_results(AppDir, Expected, ProfileRun) -> ; ({file, Filename}) -> ct:pal("Filename: ~s", [Filename]), ?assert(filelib:is_file(Filename)) + ; ({dir, Dirname}) -> + ct:pal("Directory: ~s", [Dirname]), + ?assert(filelib:is_dir(Dirname)) end, Expected). write_src_file(Dir, Name) -> @@ -422,7 +425,7 @@ get_app_metadata(Name, Vsn, Deps) -> package_app(AppDir, DestDir, PkgName) -> Name = PkgName++".tar", - {ok, Fs} = file:list_dir(AppDir), + {ok, Fs} = rebar_utils:list_dir(AppDir), ok = erl_tar:create(filename:join(DestDir, "contents.tar.gz"), lists:zip(Fs, [filename:join(AppDir,F) || F <- Fs]), [compressed]), -- cgit v1.1