File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
fixtures/rebar_dep/apps/another Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,10 @@ defmodule Mix.Rebar do
69
69
Runs `fun` for the given config and for each `sub_dirs` in the
70
70
given rebar config.
71
71
"""
72
+ def recur ( [ h | _ ] = config , fun ) when is_integer ( h ) do
73
+ recur ( load_config ( config ) , fun )
74
+ end
75
+
72
76
def recur ( config , fun ) do
73
77
subs = ( config [ :sub_dirs ] || [ ] )
74
78
|> Enum . map ( & Path . wildcard ( & 1 ) )
Original file line number Diff line number Diff line change
1
+ { sub_dirs , [" from_apps_another" ] }.
Original file line number Diff line number Diff line change @@ -45,10 +45,27 @@ defmodule Mix.RebarTest do
45
45
Mix.Project . pop
46
46
end
47
47
48
+ test "recurs over sub dirs" do
49
+ path = MixTest.Case . fixture_path ( "rebar_dep" )
50
+
51
+ File . cd! path , fn ->
52
+ config = Mix.Rebar . load_config ( path )
53
+
54
+ Mix.Rebar . recur ( config , fn config ->
55
+ if config [ :sub_dirs ] == [ 'from_apps_another' ] do
56
+ Process . put ( :inside_apps_another , true )
57
+ end
58
+ end )
59
+ end
60
+
61
+ unless Process . get ( :inside_apps_another ) do
62
+ flunk "Expected inside_apps_another to return true"
63
+ end
64
+ end
65
+
48
66
test "get and compile dependencies for rebar" do
49
67
# Use rebar from project root
50
68
System . put_env ( "MIX_HOME" , MixTest.Case . elixir_root )
51
-
52
69
Mix.Project . push ( RebarAsDep )
53
70
54
71
in_tmp "get and compile dependencies for rebar" , fn ->
You can’t perform that action at this time.
0 commit comments