@@ -3,8 +3,13 @@ defmodule Mix.Dep.Umbrella do
33
44 @ doc """
55 Gets all umbrella dependencies in unloaded format.
6+
7+ The environment is required and usually is set to
8+ `Mix.env` (i.e. the same environment as the parent
9+ project). However, it may be nil when invoked by
10+ the fetcher so all deps are fetched recursively.
611 """
7- def unloaded do
12+ def unloaded ( env ) do
813 config = Mix.Project . config
914
1015 if apps_path = config [ :apps_path ] do
@@ -14,7 +19,7 @@ defmodule Mix.Dep.Umbrella do
1419 paths
1520 |> extract_umbrella
1621 |> filter_umbrella ( config [ :apps ] )
17- |> to_umbrella_dep ( build , Path . absname ( "mix.exs" ) )
22+ |> to_umbrella_dep ( build , Path . absname ( "mix.exs" ) , env )
1823 else
1924 [ ]
2025 end
@@ -24,7 +29,7 @@ defmodule Mix.Dep.Umbrella do
2429 Gets all umbrella dependencies in the loaded format.
2530 """
2631 def loaded do
27- deps = unloaded
32+ deps = unloaded ( Mix . env )
2833 apps = Enum . map ( deps , & ( & 1 . app ) )
2934
3035 Enum . map ( deps , fn umbrella_dep ->
@@ -48,10 +53,10 @@ defmodule Mix.Dep.Umbrella do
4853 for { app , _ } = pair <- pairs , app in apps , do: pair
4954 end
5055
51- defp to_umbrella_dep ( paths , build , from ) do
56+ defp to_umbrella_dep ( paths , build , from , env ) do
5257 Enum . map paths , fn ( { app , path } ) ->
5358 opts = [ path: path , dest: Path . expand ( path ) , from_umbrella: true ,
54- env: Mix . env , build: Path . join ( [ build , "lib" , Atom . to_string ( app ) ] ) ]
59+ env: env , build: Path . join ( [ build , "lib" , Atom . to_string ( app ) ] ) ]
5560 % Mix.Dep {
5661 scm: Mix.SCM.Path ,
5762 app: app ,
0 commit comments