File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ defmodule Mix.Tasks.Compile.Protocols do
14
14
protocol versions. Simply add it to your codepath to
15
15
make use of it:
16
16
17
- mix run -pa consolidated
17
+ mix run -pa _build/dev/ consolidated
18
18
19
19
You can verify a protocol is consolidated by checking
20
20
its attributes:
21
21
22
- elixir -pa consolidated -S \
22
+ elixir -pa _build/dev/ consolidated -S \
23
23
mix run -e "IO.puts Protocol.consolidated?(Enumerable)"
24
24
25
25
"""
@@ -31,7 +31,7 @@ defmodule Mix.Tasks.Compile.Protocols do
31
31
paths = filter_otp ( :code . get_path , :code . lib_dir )
32
32
paths
33
33
|> Protocol . extract_protocols
34
- |> consolidate ( paths , opts [ :output ] || "consolidated" )
34
+ |> consolidate ( paths , opts [ :output ] || Path . join ( Mix.Project . build_path , "consolidated" ) )
35
35
36
36
:ok
37
37
end
@@ -50,6 +50,9 @@ defmodule Mix.Tasks.Compile.Protocols do
50
50
File . write! ( Path . join ( output , "#{ protocol } .beam" ) , binary )
51
51
Mix . shell . info "Consolidated #{ inspect protocol } "
52
52
end
53
+
54
+ relative = Path . relative_to_cwd ( output )
55
+ Mix . shell . info "Consolidated protocols written to #{ relative } "
53
56
end
54
57
55
58
defp maybe_reload ( module ) do
Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ defmodule Mix.Tasks.Compile.ProtocolsTest do
10
10
assert Mix.Tasks.Compile.Protocols . run ( [ ] ) == :ok
11
11
assert_received { :mix_shell , :info , [ "Consolidated Enumerable" ] }
12
12
13
- assert File . regular? "consolidated/Elixir.Enumerable.beam"
13
+ assert File . regular? "_build/dev/ consolidated/Elixir.Enumerable.beam"
14
14
purge [ Enumerable ]
15
15
16
- Code . prepend_path ( "consolidated" )
16
+ Code . prepend_path ( "_build/dev/ consolidated" )
17
17
assert Protocol . consolidated? ( Enumerable )
18
18
end
19
19
after
You can’t perform that action at this time.
0 commit comments