12345678910111213141516171819202122232425262728293031 |
- %% -*- mode: erlang -*-
- 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),
- case application:get_key(syntax_tools, vsn) of
- {ok, Vsn} when "1.7" > Vsn ->
- Deps = [{merl, ".*",
- {git, "git://github.com/erlydtl/merl.git", {branch, "erlydtl"}},
- [raw]}],
- PreHooks =
- [{"(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_DEPS_DIR%/merl\" all -W test"},
- {"(linux|darwin|solaris)", eunit, "make -C \"$REBAR_DEPS_DIR/merl\" test"},
- {"(freebsd|netbsd|openbsd)", eunit, "gmake -C \"$REBAR_DEPS_DIR/merl\" test"},
- {"win32", eunit, "make -C \"%REBAR_DEPS_DIR%/merl\" test"}],
- lists:foldl(fun ({K, V}, C) -> Patch(K, V, C) end, CONFIG,
- [{deps, Deps},
- {pre_hooks, PreHooks},
- {erl_opts, [{d, 'MERL_DEP'}]}]);
- _ ->
- CONFIG
- end.
|