Skip to content

Commit

Permalink
V0.9 (#5)
Browse files Browse the repository at this point in the history
* add Erlang 21 to supported versions, drop old ones
* update build flow
* support rebar3
* add license
  • Loading branch information
danikp authored Oct 31, 2018
1 parent 124c75f commit 5f13986
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 38 deletions.
17 changes: 13 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
ebin/
*~
/.project
/.settings/
erl_crash.dump
/.settings
/.rebar/
.settings
rebar3.crashdump
/_build
/deps
.eunit
/ebin
/doc
rebar.lock
.project
.idea
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
language: erlang
sudo: false
otp_release:
# Test on all supported releases
# Test on all supported releases & some more
- 21.1
- 21.0
- 20.3
- 19.3
Expand All @@ -10,8 +11,8 @@ otp_release:

script:
- make
- rebar eunit -v skip_deps=true
- make plt
- make test
- make dialyze

notifications:
email: false
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
39 changes: 13 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,35 @@
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

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
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)

.PHONY: test
test:
@$(REBAR) eunit
Binary file removed rebar
Binary file not shown.
29 changes: 26 additions & 3 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
{erl_opts, [debug_info]}.
{deps, [
]}.
{erl_opts, [
debug_info,
warn_unused_vars,
warn_unused_import,
warn_exported_vars
]}.

{deps, []}.

%% == 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, "tiny_pq"},
{base_plt_apps, [stdlib, kernel, erts]},
{base_plt_location, global}, % global | "/my/file/name"
{base_plt_prefix, "rebar3"}
]}.

{cover_enabled, true}.

{plugins, []}.

9 changes: 7 additions & 2 deletions src/tiny_pq.app.src
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{application, tiny_pq, [
{description, "TinyPQ: A simple priority queue based on gb_trees"},
{vsn, "0.8.17"},
{vsn, "0.9.0"},
{registered, []},
{modules, []},
{applications, [
kernel,
stdlib
]},
{env, []}
{env, []},
{maintainers, ["ChicagoBoss Team"]},
{licenses, ["MIT/X11"]},
{links, [
{"Github", "https://github.com/ChicagoBoss/tiny_pq"}
]}
]}.

0 comments on commit 5f13986

Please sign in to comment.