couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [04/50] rebar commit: updated refs/heads/import to e9f62c4
Date Mon, 01 Jun 2015 20:41:58 GMT
Rebasing. Fix differences with c26b0c7 c996e98 b690842.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/258ab8a6
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/258ab8a6
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/258ab8a6

Branch: refs/heads/import
Commit: 258ab8a62330e1a86bdd0e45e386218f25005c35
Parents: e3d2142
Author: Pierre Fenoll <pierrefenoll@gmail.com>
Authored: Fri Jun 13 14:29:54 2014 +0200
Committer: Pierre Fenoll <pierrefenoll@gmail.com>
Committed: Fri Jun 13 14:39:15 2014 +0200

----------------------------------------------------------------------
 THANKS                      |  1 +
 src/rebar_erlc_compiler.erl | 18 ++++++++----------
 2 files changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/258ab8a6/THANKS
----------------------------------------------------------------------
diff --git a/THANKS b/THANKS
index ee95cee..1230ec3 100644
--- a/THANKS
+++ b/THANKS
@@ -125,3 +125,4 @@ YeJun Su
 Yuki Ito
 alisdair sullivan
 Alexander Verbitsky
+Pierre Fenoll

http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/258ab8a6/src/rebar_erlc_compiler.erl
----------------------------------------------------------------------
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index 1de9cb2..16a7a35 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -148,11 +148,9 @@ test_compile(Config, Cmd, OutDir) ->
     %% in src but in a subdirectory of src. Cover only looks in cwd and ../src
     %% for source files. Also copy files from src_dirs.
     SrcDirs = rebar_utils:src_dirs(proplists:append_values(src_dirs, ErlOpts1)),
-    SrcErls = lists:foldl(
-                fun(Dir, Acc) ->
-                        Files = rebar_utils:find_files(Dir, ".*\\.erl\$"),
-                        lists:append(Acc, Files)
-                end, [], SrcDirs),
+    SrcErls = lists:flatmap(
+                fun (Dir) -> rebar_utils:find_files(Dir, ".*\\.erl$") end,
+                SrcDirs),
 
     %% If it is not the first time rebar eunit or rebar qc is executed,
     %% there will be source files already present in OutDir. Since some
@@ -163,17 +161,17 @@ test_compile(Config, Cmd, OutDir) ->
     %% rebar_file_utils:cp_r.
 
     %% Get the full path to a file that was previously copied in OutDir
-    ToCleanUp = fun(F, Acc) ->
+    ToCleanUp = fun(F) ->
                         F2 = filename:basename(F),
                         F3 = filename:join([OutDir, F2]),
                         case filelib:is_regular(F3) of
-                            true -> [F3|Acc];
-                            false -> Acc
+                            true -> F3;
+                            false -> []
                         end
                 end,
 
-    ok = rebar_file_utils:delete_each(lists:foldl(ToCleanUp, [], TestErls)),
-    ok = rebar_file_utils:delete_each(lists:foldl(ToCleanUp, [], SrcErls)),
+    ok = rebar_file_utils:delete_each(lists:flatmap(ToCleanUp, TestErls)),
+    ok = rebar_file_utils:delete_each(lists:flatmap(ToCleanUp, SrcErls)),
 
     ok = rebar_file_utils:cp_r(SrcErls ++ TestErls, OutDir),
 


Mime
View raw message