Skip to content

Commit e975613

Browse files
committed
Load extra applications for umbrellas
1 parent b1a1dd0 commit e975613

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

lib/mix/lib/mix/tasks/compile.all.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ defmodule Mix.Tasks.Compile.All do
125125
Enum.reduce(Mix.ProjectStack.pop_after_compiler(compiler), result, & &1.(&2))
126126
end
127127

128-
defp project_apps(config) do
128+
def project_apps(config) do
129129
project = Mix.Project.get!()
130130

131131
properties =

lib/mix/lib/mix/tasks/compile.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ defmodule Mix.Tasks.Compile do
148148
# If we are in an umbrella project, now load paths from all children.
149149
if apps_paths = Mix.Project.apps_paths(config) do
150150
loaded_paths =
151-
apps_paths
152-
|> Map.keys()
151+
(Mix.Tasks.Compile.All.project_apps(config) ++ Map.keys(apps_paths))
153152
|> Mix.AppLoader.load_apps(Mix.Dep.cached(), config, [], fn
154153
{_app, path}, acc -> if path, do: [path | acc], else: acc
155154
end)

lib/mix/test/fixtures/umbrella_dep/deps/umbrella/mix.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ defmodule Umbrella.MixProject do
44
def project do
55
[apps_path: "apps"]
66
end
7+
8+
def application do
9+
[extra_applications: [:runtime_tools]]
10+
end
711
end

lib/mix/test/mix/umbrella_test.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ defmodule Mix.UmbrellaTest do
6464
Mix.Task.run("deps.loadpaths")
6565
Mix.Task.run("compile", ["--verbose"])
6666

67+
# Extra applications are picked even for umbrellas
68+
assert :code.where_is_file(~c"runtime_tools.app") != :non_existing
69+
assert :code.where_is_file(~c"observer.app") == :non_existing
70+
6771
assert_received {:mix_shell, :info, ["==> bar"]}
6872
assert_received {:mix_shell, :info, ["Generated bar app"]}
6973
assert File.regular?("_build/dev/lib/bar/ebin/Elixir.Bar.beam")

0 commit comments

Comments
 (0)