Rebar3 - Rebar2 diff #2

Closed
wants to merge 48 commits into
from
Commits
Jump to file
+1,763 −295
Unified
View
@@ -23,3 +23,6 @@ current_counterexample.eqc
apps/sniffle/include/sniffle_version.hrl apps/sniffle/include/sniffle_version.hrl
ebin ebin
dev-data dev-data
+_build
+apps/sniffle_version/include/sniffle_version.hrl
+TEST*
View
@@ -1,9 +1,8 @@
-REBAR = $(shell pwd)/rebar +REBAR = $(shell pwd)/rebar3
-.PHONY: deps rel stagedevrel package version all +.PHONY: rel stagedevrel package version all
- +all: cp-hooks compile
-all: cp-hooks deps compile
cp-hooks: cp-hooks:
cp hooks/* .git/hooks cp hooks/* .git/hooks
@@ -12,127 +11,62 @@ version:
@echo "$(shell git symbolic-ref HEAD 2> /dev/null | cut -b 12-)-$(shell git log --pretty=format:'%h, %ad' -1)" > sniffle.version @echo "$(shell git symbolic-ref HEAD 2> /dev/null | cut -b 12-)-$(shell git log --pretty=format:'%h, %ad' -1)" > sniffle.version
version_header: version version_header: version
- @echo "-define(VERSION, <<\"$(shell cat sniffle.version)\">>)." > apps/sniffle/include/sniffle_version.hrl + @echo "-define(VERSION, <<\"$(shell cat sniffle.version)\">>)." > apps/sniffle_version/include/sniffle_version.hrl
-compile: version_header +compile:
$(REBAR) compile $(REBAR) compile
-deps:
- $(REBAR) get-deps
-
clean: clean:
$(REBAR) clean $(REBAR) clean
make -C rel/pkg clean make -C rel/pkg clean
- rm -r apps/*/ebin
-
-distclean: clean devclean relclean
- $(REBAR) delete-deps
long-test: long-test:
- -rm -r apps/sniffle/.eunit + $(REBAR) as eqc,long eunit
- $(REBAR) skip_deps=true -DEQC_LONG_TESTS eunit -v -r
eunit: eunit:
$(REBAR) compile $(REBAR) compile
- -rm -r apps/sniffle/.eunit + $(REBAR) eunit -v
- $(REBAR) eunit skip_deps=true -r -v
test: eunit test: eunit
- $(REBAR) xref skip_deps=true -r + $(REBAR) xref
quick-xref: quick-xref:
- $(REBAR) xref skip_deps=true -r + $(REBAR) xref
quick-test: quick-test:
- -rm -r apps/sniffle/.eunit + $(REBAR) as eqc,short eunit -v
- $(REBAR) -DEQC_SHORT_TEST skip_deps=true eunit -r -v
-
-rel: all zabbix
- [ -d rel/sniffle/share ] && rm -r rel/sniffle/share || true
- $(REBAR) generate
-
-relclean:
- rm -rf rel/sniffle
-devrel: dev1 dev2 dev3 dev4 +rel:
+ $(REBAR) as prod compile
+ sh generate_zabbix_template.sh
+ $(REBAR) release
-package: rel +package:
make -C rel/pkg package make -C rel/pkg package
-zabbix:
- sh generate_zabbix_template.sh
-
### ###
### Docs ### Docs
### ###
docs: docs:
- $(REBAR) skip_deps=true doc + $(REBAR) edoc
## ##
## Developer targets ## Developer targets
## ##
xref: all xref: all
- $(REBAR) xref skip_deps=true -r + $(REBAR) xref
-
-stage : rel
- $(foreach dep,$(wildcard deps/* wildcard apps/*), rm -rf rel/sniffle/lib/$(shell basename $(dep))-* && ln -sf $(abspath $(dep)) rel/sniffle/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)
-
## ##
## Dialyzer ## Dialyzer
## ##
APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \ APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \
xmerl webtool snmp public_key mnesia eunit syntax_tools compiler edoc xmerl webtool snmp public_key mnesia eunit syntax_tools compiler edoc
-COMBO_PLT = $(HOME)/.sniffle_combo_dialyzer_plt
-
# DIALYZER_IGNORE="^\(riak_core\|leexinc.hrl\|pokemon_pb.erl\|meck_cover.erl\|meck.erl\|supervisor_pre_r14b04.erl\|webmachine_resource.erl\|uuid.erl\|gen_server2.erl\|folsom_vm_metrics.erl\|protobuffs_compile.erl\)" # DIALYZER_IGNORE="^\(riak_core\|leexinc.hrl\|pokemon_pb.erl\|meck_cover.erl\|meck.erl\|supervisor_pre_r14b04.erl\|webmachine_resource.erl\|uuid.erl\|gen_server2.erl\|folsom_vm_metrics.erl\|protobuffs_compile.erl\)"
-check_plt: deps compile
- dialyzer --check_plt --plt $(COMBO_PLT) --apps $(APPS) \
- deps/*/ebin apps/*/ebin
-
-build_plt: deps compile
- dialyzer --build_plt --output_plt $(COMBO_PLT) --apps $(APPS) \
- deps/*/ebin apps/*/ebin
-
dialyzer: deps compile dialyzer: deps compile
- @echo + $(REBAR) dialyzer -Wno_return | grep -v -f dialyzer.mittigate
- @echo Use "'make check_plt'" to check PLT prior to using this target. +
- @echo Use "'make build_plt'" to build PLT prior to using this target.
- @echo
- @sleep 1
- dialyzer -Wno_return --plt $(COMBO_PLT) deps/*/ebin apps/*/ebin | grep -v -f dialyzer.mittigate
-
-dialyzer-gui: deps compile
- dialyzer --gui -Wno_return --plt $(COMBO_PLT) deps/*/ebin apps/*/ebin
typer: typer:
- typer --plt $(COMBO_PLT) deps/*/ebin apps/*/ebin + typer --plt ./_build/default/rebar3_*_plt _build/default/lib/*/ebin
-
-cleanplt:
- @echo
- @echo "Are you sure? It takes about 1/2 hour to re-build."
- @echo Deleting $(COMBO_PLT) in 5 seconds.
- @echo
- sleep 5
- rm $(COMBO_PLT)
-
-tags:
- find . -name "*.[he]rl" -print | etags -
View
@@ -0,0 +1,10 @@
+
+# Dev setup:
+
+```
+S=/root/sniffle/_build/default/rel/sniffle
+D=/opt/local/fifo-sniffle
+for i in `ls $S`; do ln -s $S/$i $D/$i; done
+rm -r $D/etc
+cp -r $S/etc $D
+```
@@ -13,6 +13,8 @@
libchunter, libchunter,
libhowl, libhowl,
libsnarl, libsnarl,
+ fifo_dt,
+ fifo_spec,
fifo_db, fifo_db,
fifo_s3, fifo_s3,
crypto, crypto,
@@ -24,14 +26,15 @@
mnesia, mnesia,
eplugin, eplugin,
lager, lager,
- recon, + jsxd,
sniffle_commons, sniffle_commons,
sniffle_console, sniffle_console,
sniffle_dtrace, sniffle_dtrace,
sniffle_read, sniffle_read,
sniffle_write, sniffle_write,
sniffle_coverage, sniffle_coverage,
sniffle_dataset_download, sniffle_dataset_download,
+ sniffle_version,
lager_watchdog lager_watchdog
]}, ]},
{mod, {sniffle_app, []}}, {mod, {sniffle_app, []}},
@@ -2,8 +2,6 @@
-behaviour(application). -behaviour(application).
--include("sniffle_version.hrl").
-
%% Application callbacks %% Application callbacks
-export([start/2, stop/1]). -export([start/2, stop/1]).
@@ -1,5 +1,4 @@
-module(sniffle_snmp_handler). -module(sniffle_snmp_handler).
--include("sniffle_version.hrl").
%% External exports %% External exports
-export([start/0, name/1, reload/0, version/1, -export([start/0, name/1, reload/0, version/1,
@@ -44,7 +43,7 @@ name(get) ->
{value, "Sniffle"}. {value, "Sniffle"}.
version(get) -> version(get) ->
- {value, binary_to_list(?VERSION)}. + {value, binary_to_list(sniffle_version:v())}.
ring_status(get) -> ring_status(get) ->
@@ -6,6 +6,7 @@
{applications, [ {applications, [
kernel, kernel,
sniffle, sniffle,
+ sniffle_version,
mdns_server_lib, mdns_server_lib,
stdlib stdlib
]}, ]},
@@ -2,8 +2,6 @@
-export([init/2, message/2, raw/2]). -export([init/2, message/2, raw/2]).
--include_lib("../sniffle/include/sniffle_version.hrl").
-
-ignore_xref([init/2, message/2, raw/2]). -ignore_xref([init/2, message/2, raw/2]).
-define(HM(M), -define(HM(M),
@@ -91,7 +89,7 @@ raw(_Data, State) ->
-spec message(message(), any()) -> any(). -spec message(message(), any()) -> any().
message(version, State) -> message(version, State) ->
- {reply, {ok, ?VERSION}, State}; + {reply, {ok, sniffle_version:v()}, State};
message({s3, Type}, State) -> message({s3, Type}, State) ->
%% {ok,{S3Host, S3Port, AKey, SKey, Bucket}} %% {ok,{S3Host, S3Port, AKey, SKey, Bucket}}
@@ -8,6 +8,7 @@
{registered, []}, {registered, []},
{applications, [ {applications, [
kernel, kernel,
+ fifo_utils,
stdlib stdlib
]}, ]},
{env, []} {env, []}
@@ -9,6 +9,9 @@
{applications, [ {applications, [
kernel, kernel,
lager, lager,
+ sniffle_version,
+ libleofs,
+ cluster_info,
stdlib stdlib
]}, ]},
{env, []} {env, []}
Oops, something went wrong.