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
6969 Runs `fun` for the given config and for each `sub_dirs` in the
7070 given rebar config.
7171 """
72+ def recur ( [ h | _ ] = config , fun ) when is_integer ( h ) do
73+ recur ( load_config ( config ) , fun )
74+ end
75+
7276 def recur ( config , fun ) do
7377 subs = ( config [ :sub_dirs ] || [ ] )
7478 |> 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
4545 Mix.Project . pop
4646 end
4747
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+
4866 test "get and compile dependencies for rebar" do
4967 # Use rebar from project root
5068 System . put_env ( "MIX_HOME" , MixTest.Case . elixir_root )
51-
5269 Mix.Project . push ( RebarAsDep )
5370
5471 in_tmp "get and compile dependencies for rebar" , fn ->
You can’t perform that action at this time.
0 commit comments