@@ -88,25 +88,30 @@ defmodule Mix.Rebar do
88
88
{ app , compile_req ( req ) , [ path: Path . join ( deps_dir , app ) ] }
89
89
end
90
90
91
- defp parse_dep ( { app , req , source } , _deps_dir ) do
91
+ defp parse_dep ( { app , req , source } , deps_dir ) do
92
+ parse_dep ( { app , req , source , [ ] } , deps_dir )
93
+ end
94
+
95
+ defp parse_dep ( { app , req , source , opts } , _deps_dir ) do
92
96
[ scm , url | source ] = tuple_to_list ( source )
97
+ mix_opts = [ { scm , to_string ( url ) } ]
93
98
94
- { ref , source } = case source do
95
- [ "" | s ] -> { [ branch: "HEAD" ] , s }
96
- [ { :branch , branch } | s ] -> { [ branch: to_string ( branch ) ] , s }
97
- [ { :tag , tag } | s ] -> { [ tag: to_string ( tag ) ] , s }
98
- [ ref | s ] -> { [ ref: to_string ( ref ) ] , s }
99
- _ -> { [ ] , [ ] }
100
- end
99
+ ref =
100
+ case source do
101
+ [ "" | _ ] -> [ branch: "HEAD" ]
102
+ [ { :branch , branch } | _ ] -> [ branch: to_string ( branch ) ]
103
+ [ { :tag , tag } | _ ] -> [ tag: to_string ( tag ) ]
104
+ [ ref | _ ] -> [ ref: to_string ( ref ) ]
105
+ _ -> [ ]
106
+ end
107
+
108
+ mix_opts = mix_opts ++ ref
101
109
102
- raw = case source do
103
- [ [ :raw ] | _ ] -> [ app: false ]
104
- [ [ raw: true ] | _ ] -> [ app: false ]
105
- _ -> [ ]
110
+ if :proplists . get_value ( :raw , opts , false ) do
111
+ mix_opts = mix_opts ++ [ compile: false ]
106
112
end
107
113
108
- opts = [ { scm , to_string ( url ) } ] ++ ref ++ raw
109
- { app , compile_req ( req ) , opts }
114
+ { app , compile_req ( req ) , mix_opts }
110
115
end
111
116
112
117
defp parse_dep ( app , deps_dir ) do
0 commit comments