@@ -53,7 +53,9 @@ defmodule Mix.Tasks.Deps.Compile do
53
53
Mix.Dep [ app : app , status: status , opts: opts ] = dep
54
54
55
55
check_unavailable! ( app , status )
56
- unless run_opts [ :quiet ] , do: shell . info "* Compiling #{ app } "
56
+ unless run_opts [ :quiet ] || opts [ :compile ] == false do
57
+ shell . info "* Compiling #{ app } "
58
+ end
57
59
58
60
deps_path = opts [ :dest ]
59
61
root_path = Path . expand ( Mix . project [ :deps_path ] )
@@ -69,12 +71,17 @@ defmodule Mix.Tasks.Deps.Compile do
69
71
Enum . each ebins , fn ebin -> :code . del_path ( ebin |> Path . expand ) end
70
72
71
73
compiled = cond do
72
- opts [ :compile ] -> File . cd! deps_path , fn -> do_compile app , opts [ :compile ] end
73
- mix? ( dep ) -> File . cd! deps_path , fn -> do_mix dep , config end
74
- rebar? ( dep ) -> File . cd! deps_path , fn -> do_rebar app , root_path end
75
- make? ( dep ) -> File . cd! deps_path , fn -> do_command app , "make" end
76
- true -> shell . error "Could not compile #{ app } , no mix.exs, rebar.config or Makefile " <>
77
- "(pass :compile as an option to customize compilation, set it to :noop to do nothing)"
74
+ not nil? ( opts [ :compile ] ) ->
75
+ File . cd! deps_path , fn -> do_compile app , opts [ :compile ] end
76
+ mix? ( dep ) ->
77
+ File . cd! deps_path , fn -> do_mix dep , config end
78
+ rebar? ( dep ) ->
79
+ File . cd! deps_path , fn -> do_rebar app , root_path end
80
+ make? ( dep ) ->
81
+ File . cd! deps_path , fn -> do_command app , "make" end
82
+ true ->
83
+ shell . error "Could not compile #{ app } , no mix.exs, rebar.config or Makefile " <>
84
+ "(pass :compile as an option to customize compilation, set it to false to do nothing)"
78
85
end
79
86
80
87
Enum . each ebins , & Code . prepend_path / 1
0 commit comments