@@ -8,6 +8,8 @@ defmodule Mix.Server do
88 shell: Mix.Shell.IO , scm: Ordset . new , env: nil , post_config: [ ] ,
99 io_done: false
1010
11+ defrecord Project , name: nil , config: nil
12+
1113 def start_link ( env ) do
1214 :gen_server . start_link ( { :local , __MODULE__ } , __MODULE__ , env , [ ] )
1315 end
@@ -56,7 +58,7 @@ defmodule Mix.Server do
5658
5759 def handle_call ( :pop_project , _from , config ) do
5860 case config . projects do
59- [ { project , _ } | tail ] ->
61+ [ Project [ name : project ] | tail ] ->
6062 { :reply , project , config . projects ( tail ) . io_done ( false ) }
6163 _ ->
6264 { :reply , nil , config }
@@ -106,10 +108,11 @@ defmodule Mix.Server do
106108 { :noreply , config . update_tasks Ordset . filter ( fn { t , _ } -> t != task end , & 1 ) }
107109 end
108110
109- def handle_cast ( { :push_project , name , project } , config ) do
110- project = Keyword . merge ( project , config . post_config )
111+ def handle_cast ( { :push_project , name , conf } , config ) do
112+ conf = Keyword . merge ( conf , config . post_config )
113+ project = Project [ name : name , config: conf ]
111114 config = config . post_config ( [ ] )
112- . update_projects ( [ { name , project } | & 1 ] )
115+ . update_projects ( [ project | & 1 ] )
113116 . io_done ( false )
114117 { :noreply , config }
115118 end
@@ -136,13 +139,16 @@ defmodule Mix.Server do
136139
137140 # Returns if project is part of an umbrella project
138141 defp in_umbrella? ( config ) do
139- Enum . any? config . projects , fn { _ , conf } -> conf [ :apps_path ] != nil end
142+ Enum . any? ( config . projects , fn ( Project [ config : conf ] ) ->
143+ conf [ :apps_path ] != nil
144+ end )
140145 end
141146
142147 # Returns if project is an umbrella project
143148 defp umbrella? ( config ) do
144149 case config . projects do
145- [ { h , conf } | _ ] when h != nil -> conf [ :apps_path ] != nil
150+ [ Project [ name : name , config: config ] | _ ] when name != nil ->
151+ config [ :apps_path ] != nil
146152 _ -> false
147153 end
148154 end
0 commit comments