@@ -15,7 +15,7 @@ defmodule Mix.Dep.Loader do
15
15
current environment, behaviour can be overridden via options.
16
16
"""
17
17
def children ( ) do
18
- mix_children ( [ ] ) ++ Mix.Dep.Umbrella . unloaded ( )
18
+ mix_children ( Mix.Project . config ( ) , [ ] ) ++ Mix.Dep.Umbrella . unloaded ( )
19
19
end
20
20
21
21
@ doc """
@@ -289,6 +289,8 @@ defmodule Mix.Dep.Loader do
289
289
290
290
defp mix_dep ( % Mix.Dep { app: app , opts: opts } = dep , nil ) do
291
291
Mix.Dep . in_dependency ( dep , fn _ ->
292
+ config = Mix.Project . config ( )
293
+
292
294
opts =
293
295
if Mix.Project . umbrella? ( ) do
294
296
Keyword . put_new ( opts , :app , false )
@@ -298,14 +300,12 @@ defmodule Mix.Dep.Loader do
298
300
299
301
child_opts =
300
302
if opts [ :from_umbrella ] do
301
- config = Mix.Project . config ( )
302
-
303
303
if config [ :app ] != app do
304
304
Mix . raise (
305
305
"Umbrella app #{ inspect ( config [ :app ] ) } is located at " <>
306
- "directory #{ Atom . to_string ( app ) } , and different names cause " <>
307
- "a name mismatch that's not allowed . Please rename either " <>
308
- "app's directory name or app's name in mix.exs to be equal ."
306
+ "directory #{ app } . Mix requires the directory to match " <>
307
+ "the application name for umbrella apps . Please rename the " <>
308
+ "directory or change the application name in the mix.exs file ."
309
309
)
310
310
end
311
311
@@ -314,7 +314,7 @@ defmodule Mix.Dep.Loader do
314
314
[ env: Keyword . fetch! ( opts , :env ) ]
315
315
end
316
316
317
- deps = mix_children ( child_opts ) ++ Mix.Dep.Umbrella . unloaded ( )
317
+ deps = mix_children ( config , child_opts ) ++ Mix.Dep.Umbrella . unloaded ( )
318
318
{ % { dep | opts: opts } , deps }
319
319
end )
320
320
end
@@ -352,10 +352,10 @@ defmodule Mix.Dep.Loader do
352
352
{ dep , [ ] }
353
353
end
354
354
355
- defp mix_children ( opts ) do
355
+ defp mix_children ( config , opts ) do
356
356
from = Path . absname ( "mix.exs" )
357
357
358
- ( Mix.Project . config ( ) [ :deps ] || [ ] )
358
+ ( config [ :deps ] || [ ] )
359
359
|> Enum . map ( & to_dep ( & 1 , from ) )
360
360
|> split_by_env_and_target ( { opts [ :env ] , nil } )
361
361
|> elem ( 0 )
0 commit comments