@@ -135,11 +135,20 @@ start_dev_cmd(_RebarConf, BossConf, AppFile) ->
135
135
rebar_log :log (info , " Generating dynamic start-dev command~n " , []),
136
136
137
137
AppName = app_name (AppFile ),
138
- EbinDirs = all_ebin_dirs (BossConf , AppFile ),
139
138
SName = sname (BossConf , AppFile ),
139
+ case os :type () of
140
+ {win32 , _ } ->
141
+ EbinDirs = all_ebin_dirs (windows , BossConf , AppFile ),
142
+ Dirs = io_lib :format (" ~p " , [lists :flatten (EbinDirs )]), % EbinDirs come back as a list of lists [[],[],[]]
143
+ Cmd = io_lib :format (" werl -pa ~s -boss developing_app ~s -boot start_sasl -config boss -s reloader -s boss -sname ~s " ,
144
+ [string :join (lists :append (EbinDirs ), " -pa " ), AppName , SName ]),
145
+ io :format (" ~s~n " , [Cmd ]);
146
+ _ ->
147
+ EbinDirs = all_ebin_dirs (BossConf , AppFile ),
148
+ io :format (" exec erl -pa ~s -boss developing_app ~s -boot start_sasl -config boss -s reloader -s boss -sname ~s " ,
149
+ [string :join (EbinDirs , " -pa " ), AppName , SName ])
140
150
141
- io :format (" exec erl -pa ~s -boss developing_app ~s -boot start_sasl -config boss -s reloader -s boss -sname ~s " ,
142
- [string :join (EbinDirs , " -pa " ), AppName , SName ]),
151
+ end ,
143
152
ok .
144
153
145
154
% %--------------------------------------------------------------------
@@ -323,6 +332,27 @@ all_ebin_dirs(BossConf, _AppFile) ->
323
332
[MainEbin , DepsEbin | EbinDirs ]
324
333
end end , [], lists :reverse (BossConf )).
325
334
335
+ % %--------------------------------------------------------------------
336
+ % % @doc Start the boss app
337
+ % % @spec all_ebin_dirs(windows, BossConf, _AppFile)
338
+ % % Gets the exact path name of all deps ebin dirs
339
+ % % for the apps defined in boss.config for Windows
340
+ % % @end
341
+ % %--------------------------------------------------------------------
342
+ all_ebin_dirs (windows , BossConf , _AppFile ) ->
343
+ lists :foldl (fun ({_App , Config }, EbinDirs ) ->
344
+ case lists :keyfind (path , 1 , Config ) of
345
+ false -> EbinDirs ;
346
+ {path , Path } ->
347
+ MainEbin = filename :join ([Path , " ebin" ]),
348
+ filelib :ensure_dir (filename :join ([MainEbin , " foobar" ])),
349
+ DepsEbins = case file :list_dir (Path ++ " /deps" ) of
350
+ {ok , Dirs } -> lists :map (fun (Dir ) -> Path ++ " /deps/" ++ Dir ++ " /ebin" end , Dirs );
351
+ {error , _Reason } -> []
352
+ end ,
353
+ [lists :append ([MainEbin ] , DepsEbins ) | EbinDirs ] % DepsEbins is a list, while MainEbin is a string
354
+ end end , [], lists :reverse (BossConf )).
355
+
326
356
% %--------------------------------------------------------------------
327
357
% % @doc Injects the boss.conf configuration to the boss application
328
358
% % @spec init_conf(BossConf)
0 commit comments