diff --git a/.travis.yml b/.travis.yml index 6ea2eac..e17304b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,33 +1,18 @@ language: erlang sudo: false otp_release: -# Test on all supported releases - - 20.0 +# Test on all supported releases & some more + - 21.1 + - 21.0 + - 20.3 - 19.3 - - 19.2 - - 19.1 - - 19.0 - - 18.0 + - 18.3 - 17.5 - - 17.4 - - 17.3 - - 17.1 - - 17.0 - - R16B03-1 - - R16B03 - - R16B02 - - R16B01 - - R16B - - R15B03 -# - R15B02 #fails - - R15B01 - - R15B script: - make - - rebar eunit -v skip_deps=true - make test - - make plt - make dialyze + notifications: email: false diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d135e5a --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2010-2014 Evan Miller +Copyright (c) 2014-2018 ChicagoBoss Team and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile index c075add..8435f48 100644 --- a/Makefile +++ b/Makefile @@ -1,57 +1,44 @@ -ERL=erl -REBAR=./rebar +ERL = erl GIT = git -REBAR_VER = 2.6.0 - -.PHONY: get-deps +REBAR = rebar3 +REBAR_VER = 3.6.2 all: compile compile: - @$(REBAR) get-deps @$(REBAR) compile -compile_test: - -mkdir -p ebintest - $(ERL) -make - -test: compile compile_test - $(ERL) -noshell -pa ebin -pa ebintest -pa deps/tiny_pq/ebin \ - -s tinymq_test run_tests \ - -s init stop - rebar_src: @rm -rf $(PWD)/rebar_src - @$(GIT) clone git://github.com/rebar/rebar.git rebar_src + @$(GIT) clone https://github.com/erlang/rebar3.git rebar_src @$(GIT) -C rebar_src checkout tags/$(REBAR_VER) @cd $(PWD)/rebar_src/; ./bootstrap - @cp $(PWD)/rebar_src/rebar $(PWD) + @cp $(PWD)/rebar_src/rebar3 $(PWD) @rm -rf $(PWD)/rebar_src get-deps: - @$(REBAR) get-deps + @$(REBAR) upgrade -## 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 +deps: + @$(REBAR) compile .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 ]; +dialyze: + @$(REBAR) dialyzer || [ $$? -eq 1 ]; clean: @$(REBAR) clean rm -fv erl_crash.dump - rm -f $(PLT_FILE) +compile_test: + -mkdir -p ebintest + $(ERL) -make + +test_eunit: + @$(REBAR) eunit + +.PHONY: test +test: test_eunit compile compile_test + $(ERL) -noshell -pa _build/test/lib/tinymq/ebin -pa ebintest -pa _build/test/lib/tiny_pq/ebin \ + -s tinymq_test run_tests \ + -s init stop diff --git a/rebar b/rebar deleted file mode 100755 index ed35a32..0000000 Binary files a/rebar and /dev/null differ diff --git a/rebar.config b/rebar.config index b6b8eea..246bdd0 100644 --- a/rebar.config +++ b/rebar.config @@ -1,4 +1,28 @@ -{erl_opts, [debug_info]}. +{erl_opts, [ + debug_info, + warn_unused_vars, + warn_unused_import, + warn_exported_vars +]}. + {deps, [ - {tiny_pq, ".*", {git, "https://github.com/ChicagoBoss/tiny_pq.git", {tag, "v0.8.16"}}} - ]}. + {tiny_pq, ".*", {git, "https://github.com/ChicagoBoss/tiny_pq.git", {tag, "v0.9.0"}}} +]}. + +%% == Dialyzer == +{dialyzer, [ + {warnings, [error_handling, race_conditions, unmatched_returns, underspecs]}, + {get_warnings, false}, + {plt_apps, top_level_deps}, % top_level_deps | all_deps + {plt_extra_apps, []}, + {plt_location, local}, % local | "/my/file/name" + {plt_prefix, "tinymq"}, + {base_plt_apps, [stdlib, kernel, erts]}, + {base_plt_location, global}, % global | "/my/file/name" + {base_plt_prefix, "rebar3"} +]}. + +{cover_enabled, true}. + +{plugins, []}. + diff --git a/src/tinymq.app.src b/src/tinymq.app.src index d0b8805..6363b3f 100644 --- a/src/tinymq.app.src +++ b/src/tinymq.app.src @@ -1,13 +1,17 @@ -{application, tinymq, - [ +{application, tinymq, [ {description, "TinyMQ: a diminutive message queue"}, - {vsn, "0.8.16"}, + {vsn, "0.9.0"}, {registered, [tinymq]}, {modules, []}, {applications, [ kernel, stdlib - ]}, + ]}, {env, [{max_age, 60}]}, - {mod, {tinymq_app, []}} - ]}. + {mod, {tinymq_app, []}}, + {maintainers, ["ChicagoBoss Team"]}, + {licenses, ["MIT/X11"]}, + {links, [ + {"Github", "https://github.com/ChicagoBoss/tinymq"} + ]} +]}.