diff --git a/.travis.yml b/.travis.yml index e2840ef..318683a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,28 @@ language: erlang +sudo: false otp_release: +# Test on all supported releases + - 18.0 + - 17.5 + - 17.4 + - 17.3 - 17.1 - 17.0 - R16B03-1 + - R16B03 - R16B02 - R16B01 + - R16B + - R15B03 +# - R15B02 #fails + - R15B01 + - R15B script: - - rebar get-deps - - rebar compile + - make - rebar eunit -v skip_deps=true - make test - - mkdir plt - - ./travis-dialyzer.sh + - make plt + - make dialyze notifications: - email: false + email: false diff --git a/Makefile b/Makefile index cf2b106..c075add 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ ERL=erl REBAR=./rebar GIT = git -REBAR_VER = 2.5.1 +REBAR_VER = 2.6.0 + +.PHONY: get-deps all: compile @@ -17,10 +19,7 @@ test: compile compile_test $(ERL) -noshell -pa ebin -pa ebintest -pa deps/tiny_pq/ebin \ -s tinymq_test run_tests \ -s init stop - -clean: - @$(REBAR) clean - + rebar_src: @rm -rf $(PWD)/rebar_src @$(GIT) clone git://github.com/rebar/rebar.git rebar_src @@ -28,3 +27,31 @@ rebar_src: @cd $(PWD)/rebar_src/; ./bootstrap @cp $(PWD)/rebar_src/rebar $(PWD) @rm -rf $(PWD)/rebar_src + +get-deps: + @$(REBAR) get-deps + +## dialyzer +PLT_FILE = ~/tiny_pq.plt +PLT_APPS ?= kernel stdlib erts compiler deps/* +DIALYZER_OPTS ?= -Werror_handling -Wrace_conditions -Wunmatched_returns \ + -Wunderspecs --verbose --fullpath -n + +.PHONY: dialyze +dialyze: all + @[ -f $(PLT_FILE) ] || $(MAKE) plt + @dialyzer --plt $(PLT_FILE) $(DIALYZER_OPTS) ebin || [ $$? -eq 2 ]; + +## In case you are missing a plt file for dialyzer, +## you can run/adapt this command +.PHONY: plt +plt: + @echo "Building PLT, may take a few minutes" + @dialyzer --build_plt --output_plt $(PLT_FILE) --apps \ + $(PLT_APPS) || [ $$? -eq 2 ]; + +clean: + @$(REBAR) clean + rm -fv erl_crash.dump + rm -f $(PLT_FILE) + diff --git a/rebar.config b/rebar.config index 2357b6b..82a3495 100644 --- a/rebar.config +++ b/rebar.config @@ -1,4 +1,4 @@ {erl_opts, [debug_info]}. {deps, [ - {tiny_pq, ".*", {git, "git://github.com/ChicagoBoss/tiny_pq.git", {tag, "v0.8.14"}}} + {tiny_pq, ".*", {git, "git://github.com/ChicagoBoss/tiny_pq.git", {tag, "v0.8.15"}}} ]}. diff --git a/src/tinymq.app.src b/src/tinymq.app.src index 2030a18..e2f7177 100644 --- a/src/tinymq.app.src +++ b/src/tinymq.app.src @@ -1,7 +1,7 @@ {application, tinymq, [ {description, "TinyMQ: a diminutive message queue"}, - {vsn, "0.1.2"}, + {vsn, "0.8.15"}, {registered, [tinymq]}, {modules, []}, {applications, [ diff --git a/travis-dialyzer.sh b/travis-dialyzer.sh deleted file mode 100755 index 3cac3c2..0000000 --- a/travis-dialyzer.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - - -PLT=plt/tinymq-$RANDOM.plt -echo "PLT File $PLT" -export PATH=$PATH:/usr/local/bin:/usr/bin -echo "Building PLT, may take a few minutes" -dialyzer --build_plt --apps kernel stdlib\ - --output_plt $PLT > /dev/null -for app in mnesia inets ssl crypto \ - erts public_key runtime_tools compiler asn1 hipe\ - syntax_tools -do - echo $app - dialyzer --add_to_plt --apps $app\ - --plt $PLT > /dev/null -done -rm -f deps/riak_*/ebin/*_pb.beam -echo "********************************************************************************" -for app in $(ls deps/) -do - echo "Adding $app" - dialyzer --add_to_plt --apps deps/$app \ - --plt $PLT > /dev/null - - -done -echo "********************************************************************************" -echo "" - -dialyzer ebin/ \ - -Werror_handling \ - -Wno_undefined_callbacks \ - -Wrace_conditions \ - --statistics -n \ - --fullpath \ - -n \ - --plt $PLT # -Wunmatched_returns -# - - -