Skip to content

Commit e12211a

Browse files
committed
Prepend consolidated after running
1 parent 737162c commit e12211a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/mix/lib/mix/compilers/protocol.ex

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ defmodule Mix.Compilers.Protocol do
8686

8787
def compile(force?, old_protocols_and_impls, protocols_and_impls, opts) do
8888
output = Mix.Project.consolidation_path()
89+
File.mkdir_p!(output)
90+
Code.prepend_path(output)
8991

9092
if opts[:force] || force? do
9193
clean_consolidated()
@@ -113,14 +115,11 @@ defmodule Mix.Compilers.Protocol do
113115
Enum.filter(paths, &(not :lists.prefix(otp, &1)))
114116
end
115117

116-
defp consolidate([], _paths, output, _opts) do
117-
File.mkdir_p!(output)
118+
defp consolidate([], _paths, _output, _opts) do
118119
:noop
119120
end
120121

121122
defp consolidate(protocols, paths, output, opts) do
122-
File.mkdir_p!(output)
123-
124123
protocols
125124
|> Enum.uniq()
126125
|> Enum.map(&Task.async(fn -> consolidate_each(&1, paths, output, opts) end))

0 commit comments

Comments
 (0)