浏览代码

add rebar2 support

pull/110/head
benoitc 9 年前
父节点
当前提交
e93a5bdaf0
共有 2 个文件被更改,包括 50 次插入1 次删除
  1. +44
    -0
      rebar.config.script
  2. +6
    -1
      test/jiffy_10_short_double_tests.erl

+ 44
- 0
rebar.config.script 查看文件

@ -0,0 +1,44 @@
IsRebar3 = case application:get_key(rebar, vsn) of
{ok, VSN} ->
[VSN1 | _] = string:tokens(VSN, "-"),
[Maj, Min, Patch] = string:tokens(VSN1, "."),
(list_to_integer(Maj) >= 3);
undefined ->
lists:keymember(mix, 1, application:loaded_applications())
end,
case IsRebar3 of
true ->
CONFIG;
false ->
io:format("la~n", []),
CONFIG1 = [{eunit_opts, [verbose]}, {plugins, [rebar_gdb_plugin]} | CONFIG],
ErlOpts = [{d, 'JIFFY_DEV'}],
Proper = [{proper, ".*", {git, "git://github.com/manopapad/proper.git", "master"}}],
ConfigPath = filename:dirname(SCRIPT),
DevMarker = filename:join([ConfigPath, ".jiffy.dev"]),
case filelib:is_file(DevMarker) of
true ->
% Don't override existing dependencies
CONFIG2 = case lists:keyfind(deps, 1, CONFIG1) of
false ->
CONFIG1 ++ [{deps, Proper}];
{deps, DepsList} ->
lists:keyreplace(deps, 1, CONFIG1, {deps, DepsList ++ Proper})
end,
case lists:keyfind(erl_opts, 1, CONFIG2) of
false ->
CONFIG2 ++ [{erl_opts, ErlOpts}];
{erl_opts, Opts} ->
NewOpts = {erl_opts, Opts ++ ErlOpts},
lists:keyreplace(erl_opts, 1, CONFIG2, NewOpts)
end;
false ->
CONFIG1
end
end.

+ 6
- 1
test/jiffy_10_short_double_tests.erl 查看文件

@ -8,7 +8,12 @@
-include("jiffy_util.hrl").
filename() -> "test/cases/short-doubles.txt".
filename() ->
FName = "test/cases/short-doubles.txt",
case filelib:is_file(FName) of
true -> FName;
false -> "../" ++ FName
end.
short_double_test_() ->

正在加载...
取消
保存