-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathrebar.config.script
44 lines (40 loc) · 1.77 KB
/
rebar.config.script
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
37
38
39
40
41
42
43
44
Patch = fun (Key, Value, Config) ->
case lists:keysearch(Key, 1, Config) of
{value, {_, Org}} ->
lists:keyreplace(Key, 1, Config, {Key, Org ++ Value});
false ->
[{Key, Value}|Config]
end
end,
application:load(syntax_tools),
NewCfg = case application:get_key(syntax_tools, vsn) of
{ok, Vsn} when "1.7" > Vsn ->
Deps = [{merl, ".*", {git, "https://github.com/Licenser/merl.git", {branch, "master"}}},
{erlydtl, "",
{git, "https://github.com/erlydtl/erlydtl.git",
{branch, "master"}}}],
Overrides =
[{override, erlydtl,
[{pre_hooks,
[{"(linux|darwin|solaris)", compile, "make -C \"$REBAR_DEPS_DIR/merl\" all -W test"},
{"(freebsd|netbsd|openbsd)", compile, "gmake -C \"$REBAR_DEPS_DIR/merl\" all"},
{"win32", compile, "make -C \"%REBAR_PLUGINS_DIR%/merl\" all -W test"},
{eunit,
"erlc -I include/erlydtl_preparser.hrl -o test"
" test/erlydtl_extension_testparser.yrl"},
{"(linux|darwin|solaris)", eunit, "make -C \"$REBAR_PLUGINS_DIR/merl\" test"},
{"(freebsd|netbsd|openbsd)", eunit, "gmake -C \"$REBAR_PLUGINS_DIR/merl\" test"},
{"win32", eunit, "make -C \"%REBAR_PLUGINS_DIR%/merl\" test"}
]}]}
],
[{deps, Deps},
{overrides, Overrides},
{erl_opts, [{d, 'MERL_DEP'}]}];
_ ->
[{deps, [{erlydtl, "",
{git, "https://github.com/erlydtl/erlydtl.git",
{branch, "master"}}}]}]
end,
lists:foldl(
fun ({K, V}, C) -> Patch(K, V, C) end,
CONFIG, NewCfg).