Skip to content

Commit

Permalink
Merge pull request #18 from ChicagoBoss/v0.9
Browse files Browse the repository at this point in the history
improve build process
  • Loading branch information
danikp authored Nov 1, 2018
2 parents 0e47ab2 + 4c6e5a9 commit 24e8b52
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 65 deletions.
27 changes: 6 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
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.
57 changes: 22 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Binary file removed rebar
Binary file not shown.
30 changes: 27 additions & 3 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -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, []}.

16 changes: 10 additions & 6 deletions src/tinymq.app.src
Original file line number Diff line number Diff line change
@@ -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"}
]}
]}.

0 comments on commit 24e8b52

Please sign in to comment.