-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdev.erl
36 lines (31 loc) · 774 Bytes
/
dev.erl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
-module(dev).
-export([init/0, start_deps/0]).
init() ->
R1 =
add_app_paths("deps") ++
add_app_paths("apps"),
R2 =
start_deps(),
R3 =
lists:map(fun application:start/1, [shared, model]),
R1 ++ R2 ++ R3.
add_app_paths(BaseDir) ->
{ok, Filenames} = file:list_dir(BaseDir),
lists:map(fun("." ++ _) ->
ignore;
(Filename) ->
code:add_patha(BaseDir ++ "/" ++ Filename ++ "/ebin")
end, Filenames) ++
[code:add_patha("ebin")].
start_deps() ->
R1 =
lists:map(
fun application:start/1,
[sasl, xmerl, crypto, public_key, ssl, inets, compiler]),
{ok, Filenames} = file:list_dir("deps"),
R2 =
lists:map(
fun(Filename) ->
application:start(list_to_atom(Filename))
end, Filenames),
R1 ++ R2.