@@ -114,12 +114,12 @@ defmodule Mix.Dep do
114114 write_cached_deps ( top , { env , target } , load_and_cache ( config , top , bottom , env , target ) )
115115
116116 _ ->
117- converge ( env: env , target: target )
117+ converge_and_load ( env: env , target: target )
118118 end
119119 end
120120
121121 defp load_and_cache ( _config , top , top , env , target ) do
122- converge ( env: env , target: target )
122+ converge_and_load ( env: env , target: target )
123123 end
124124
125125 defp load_and_cache ( config , _top , bottom , _env , _target ) do
@@ -152,6 +152,20 @@ defmodule Mix.Dep do
152152 end )
153153 end
154154
155+ defp converge_and_load ( opts ) do
156+ for % { app: app , opts: opts } = dep <- Mix.Dep.Converger . converge ( opts ) do
157+ case Keyword . pop ( opts , :app_properties ) do
158+ { nil , _opts } ->
159+ dep
160+
161+ { app_properties , opts } ->
162+ # We don't raise because child dependencies may be missing if manually cleaned
163+ :application . load ( { :application , app , app_properties } )
164+ % { dep | opts: opts }
165+ end
166+ end
167+ end
168+
155169 defp read_cached_deps ( project , env_target ) do
156170 case Mix.State . read_cache ( { :cached_deps , project } ) do
157171 { ^ env_target , deps } -> deps
@@ -164,6 +178,13 @@ defmodule Mix.Dep do
164178 deps
165179 end
166180
181+ @ doc """
182+ Although private API, this is kept to avoid breaking code on patch releases.
183+ """
184+ def load_on_environment ( opts ) do
185+ Mix.Dep.Converger . converge ( opts )
186+ end
187+
167188 @ doc """
168189 Clears loaded dependencies from the cache for the current environment.
169190 """
@@ -174,25 +195,6 @@ defmodule Mix.Dep do
174195 end
175196 end
176197
177- @ doc """
178- Returns loaded dependencies recursively on the given environment.
179-
180- If no environment is passed, dependencies are loaded across all
181- environments. The result is not cached.
182-
183- ## Exceptions
184-
185- This function raises an exception if any of the dependencies
186- provided in the project are in the wrong format.
187- """
188- def load_on_environment ( opts ) do
189- converge ( opts )
190- end
191-
192- defp converge ( opts ) do
193- Mix.Dep.Converger . converge ( nil , nil , opts , & { & 1 , & 2 , & 3 } ) |> elem ( 0 )
194- end
195-
196198 @ doc """
197199 Filters the given dependencies by name.
198200
0 commit comments