Commit 69d16c9b authored by Heinz N. Gies's avatar Heinz N. Gies

rebar3 compat

parent 1b4ff829
......@@ -23,3 +23,4 @@ rel/pkg/packlist
apps/dalmatiner_frontend/include/dalmatiner_frontend_version.hrl
apps/dalmatiner_frontend/src/dql_lexer.erl
apps/dalmatiner_frontend/src/dql_parser.erl
_build
REBAR = $(shell pwd)/rebar
REBAR = $(shell pwd)/rebar3
.PHONY: deps rel stagedevrel package version all
all: cp-hooks deps compile
all: cp-hooks compile
cp-hooks:
cp hooks/* .git/hooks
......@@ -16,50 +16,22 @@ version_header: version
compile: version_header
$(REBAR) compile
deps:
$(REBAR) get-deps
clean:
$(REBAR) clean
make -C rel/pkg clean
-rm -r apps/*/ebin
distclean: clean devclean relclean
$(REBAR) delete-deps
long-test:
-rm -r apps/dalmatiner_frontend/.eunit
$(REBAR) skip_deps=true -DEQC_LONG_TESTS eunit -v -r
qc:
$(REBAR) -C rebar_eqc.config compile skip_deps=true eunit --verbose
eqc-ci: clean all
$(REBAR) -D EQC_CI -C rebar_eqc_ci.config compile eunit skip_deps=true --verbose
$(REBAR) as eqc eqc
eunit:
$(REBAR) compile
-rm -r apps/dalmatiner_frontend/.eunit
$(REBAR) eunit skip_deps=true -r -v
$(REBAR) eunit
test: eunit
$(REBAR) xref skip_deps=true -r
quick-xref:
$(REBAR) xref skip_deps=true -r
quick-test:
-rm -r apps/dalmatiner_frontend/.eunit
$(REBAR) -DEQC_SHORT_TEST skip_deps=true eunit -r -v
$(REBAR) xref
rel: all
-rm -r rel/dalmatinerfe/share
$(REBAR) generate
relclean:
rm -rf rel/dalmatinerfe
devrel: dev1 dev2 dev3 dev4
$(REBAR) as prod release
package: rel
make -C rel/pkg package
......@@ -68,34 +40,14 @@ package: rel
### Docs
###
docs:
$(REBAR) skip_deps=true doc
$(REBAR) doc
##
## Developer targets
##
xref: all
$(REBAR) xref skip_deps=true -r
stage : rel
$(foreach dep,$(wildcard deps/* wildcard apps/*), rm -rf rel/dalmatinerfe/lib/$(shell basename $(dep))-* && ln -sf $(abspath $(dep)) rel/dalmatinerfe/lib;)
stagedevrel: dev1 dev2 dev3 dev4
mkdir -p dev/dev{1,2,3}/data/{ipranges,datasets,packages,ring}
$(foreach dev,$^,\
$(foreach dep,$(wildcard deps/* wildcard apps/*), rm -rf dev/$(dev)/lib/$(shell basename $(dep))-* && ln -sf $(abspath $(dep)) dev/$(dev)/lib;))
devrel: dev1 dev2 dev3 dev4
devclean:
rm -rf dev
dev1 dev2 dev3 dev4: all
mkdir -p dev
(cd rel && $(REBAR) generate target_dir=../dev/$@ overlay_vars=vars/$@.config)
$(REBAR) xref
##
## Dialyzer
......
......@@ -35,8 +35,7 @@ range(["BETWEEN", A, "AND", B | L]) ->
Ad = date(A),
metric(L, {range, Ad, date(B) - Ad});
range(["LAST", A, "S" | L]) ->
{Mega, Sec, _Micro} = now(),
Now = Mega * 1000000 + Sec,
Now = erlang:system_time(seconds),
Ad = i(A),
metric(L, {range, Now - Ad, Ad});
range(L) ->
......
......@@ -46,8 +46,7 @@ loop(Socket, Transport) ->
Transport:send(Socket, list_to_binary(R)),
loop(Socket, Transport);
{ok, <<"SELECT ", _/binary>> = Q} ->
_Now = {Mega, Sec, Micro} = now(),
NowMs = ((Mega * 1000000 + Sec) * 1000000 + Micro) div 1000,
NowMs = erlang:system_time(milli_seconds),
case timer:tc(dqe, run, [Q]) of
{T, {ok, Ls}} ->
[begin
......
......@@ -7,15 +7,7 @@
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
make quick-xref
make xref
RETVAL=$?
if [ $RETVAL -ne 0 ]
then
......@@ -23,7 +15,7 @@ then
exit 1
fi
make quick-test
make test
RETVAL=$?
if [ $RETVAL -ne 0 ]
then
......
File deleted
......@@ -7,20 +7,41 @@
{eunit_opts, [{report,{eunit_surefire,[{dir,"."}]}}]}.
{deps,
[
{lager, "2.0.*",{git, "https://github.com/basho/lager.git", {tag,"2.0.3"}}},
{cuttlefish, "2.*", {git, "https://github.com/basho/cuttlefish.git", {tag, "2.0.0"}}},
{ranch, "1.0.*", {git, "https://github.com/extend/ranch.git", {tag, "1.0.0"}}},
{cowboy, "1.0.*", {git, "https://github.com/extend/cowboy.git", {tag, "1.0.0"}}},
{jsx, "2.0.*", {git, "https://github.com/talentdeficit/jsx.git", {tag, "v2.0.4"}}},
{msgpack, ".*", {git, "git://github.com/msgpack/msgpack-erlang.git", {tag, "0.3.2"}}},
{fifo_utils, ".*", {git, "https://github.com/project-fifo/fifo_utils.git", {branch, "master"}}},
{lager, ".*", {git, "https://github.com/basho/lager", {ref,"cbf6679c6a693772fd1629c9cdc093e4c6c4ebf8"}}},
{cuttlefish, ".*", {git, "https://github.com/tsloughter/cuttlefish.git", {branch, "develop"}}},
{ranch, "1.1.0"},
{cowboy, "1.0.2"},
{jsx, "1.4.5"},
{msgpack, ".*", {git, "https://github.com/msgpack/msgpack-erlang.git", {tag, "0.3.3"}}},
{mmath, ".*", {git, "https://github.com/DalmatinerDB/mmath.git", {branch, "master"}}},
{dqe, ".*", {git, "git://github.com/dalmatinerdb/dqe.git", {branch, "master"}}}
{mmath, "0.1.7"},
{dqe, ".*", {git, "https://github.com/dalmatinerdb/dqe.git", {tag, "0.1.13"}}}
]}.
{plugin_dir, "deps/cuttlefish/src"}.
{plugins, [cuttlefish_rebar_plugin]}.
{profiles,
[{eqc,
[{plugins, [rebar3_eqc]},
{deps, [fqc]}]}]}.
{xref_checks, [undefined_function_calls, undefined_functions,
locals_not_used, % exports_not_used, that is a problem with having multiple apps
deprecated_function_calls, deprecated_functions]}.
{overrides,
[
%% R18
{override, edown,
[{erl_opts, [debug_info]}]},
{override, eper,
[{erl_opts, [debug_info]}]},
{override, pooler,
[{erl_opts,
[{platform_define, "^[0-9]+", namespaced_types},
debug_info,
inline]}]},
%% Normal
{override, setup, [{post_hooks, []}]}]}.
[{<<"cowboy">>,{pkg,<<"cowboy">>,<<"1.0.2">>},0},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"1.0.1">>},1},
{<<"cuttlefish">>,
{git,"https://github.com/tsloughter/cuttlefish.git",
{ref,"f5f6fdc1b0dd8ebe909b81f0b38f5715d4e869e6"}},
0},
{<<"ddb_client">>,{pkg,<<"ddb_client">>,<<"0.1.11">>},1},
{<<"dflow">>,{pkg,<<"dflow">>,<<"0.1.5">>},1},
{<<"dproto">>,{pkg,<<"dproto">>,<<"0.1.9">>},1},
{<<"dqe">>,
{git,"https://github.com/dalmatinerdb/dqe.git",
{ref,"f21b583dc7826e4e049bcd39587c3a7454244c39"}},
0},
{<<"erlang_localtime">>,
{git,"git://github.com/choptastic/erlang_localtime.git",
{ref,"bd0083ffe6107537a555133c9b94656ca5c854f3"}},
2},
{<<"erlware_commons">>,
{git,"git://github.com/erlware/erlware_commons.git",
{ref,"83adceaa1abc1af5358a61601b17d10c43e6d7a1"}},
2},
{<<"getopt">>,
{git,"git://github.com/jcomellas/getopt.git",
{ref,"659a28f4145bc9843598972854299dc4ea77e4cb"}},
1},
{<<"goldrush">>,
{git,"git://github.com/DeadZen/goldrush.git",
{ref,"64864ba7fcf40988361340e48680b49a2c2938cf"}},
1},
{<<"jsx">>,{pkg,<<"jsx">>,<<"1.4.5">>},0},
{<<"lager">>,
{git,"https://github.com/basho/lager",
{ref,"cbf6679c6a693772fd1629c9cdc093e4c6c4ebf8"}},
0},
{<<"mmath">>,
{git,"https://github.com/DalmatinerDB/mmath.git",
{ref,"1ead7434d7a3c56f030a0c829b03107f21a6fdbe"}},
0},
{<<"msgpack">>,
{git,"https://github.com/msgpack/msgpack-erlang.git",
{ref,"c666a5f6568ac2e15687bb155442025dbb8b74ff"}},
0},
{<<"neotoma">>,
{git,"git://github.com/seancribbs/neotoma.git",
{ref,"760928ec8870da02eb11bccb501e2700925d06c6"}},
1},
{<<"poolboy">>,{pkg,<<"poolboy">>,<<"1.5.1">>},1},
{<<"qdate">>,
{git,"https://github.com/choptastic/qdate.git",
{ref,"4135dfa8e36eb531b9fdbea8ccbce597231864fe"}},
1},
{<<"ranch">>,{pkg,<<"ranch">>,<<"1.1.0">>},0}].
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment