-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernize Makefile and rebar.config.script while fixing CI on OTP 22
- Loading branch information
Showing
3 changed files
with
68 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,91 @@ | ||
CLI_ARTIFACT_PATH = _build/escriptize/bin/locus | ||
|
||
export ERL_FLAGS = -enable-feature maybe_expr # needed for katana-code under OTP 25 | ||
SHELL := bash | ||
.ONESHELL: | ||
.SHELLFLAGS := -euc | ||
.DELETE_ON_ERROR: | ||
MAKEFLAGS += --warn-undefined-variables | ||
MAKEFLAGS += --no-builtin-rules | ||
|
||
.PHONY: all build clean check | ||
.PHONY: xref hank-dead-code-cleaner elvis-linter dialyzer | ||
.PHONY: test cover | ||
.PHONY: shell console doc-dry publish cli | ||
export ERL_FLAGS = -enable-feature maybe_expr # needed for katana-code under OTP 25 | ||
|
||
.NOTPARALLEL: check cover test | ||
## General Rules | ||
|
||
all: build | ||
all: compile | ||
.PHONY: all | ||
.NOTPARALLEL: all | ||
|
||
build: | ||
compile: | ||
@rebar3 compile | ||
.PHONY: compile | ||
|
||
clean: | ||
@rebar3 clean | ||
@rebar3 clean -a | ||
.PHONY: clean | ||
|
||
check: xref hank-dead-code-cleaner elvis-linter dialyzer | ||
.NOTPARALLEL: check | ||
.PHONY: check | ||
|
||
test: eunit ct cli | ||
./locus check --log-level debug test/priv/GeoLite2-Country.tar.gz | ||
.NOTPARALLEL: test | ||
.PHONY: test | ||
|
||
## Tests | ||
|
||
ct: | ||
@rebar3 do ct, cover | ||
.PHONY: ct | ||
|
||
eunit: | ||
@rebar3 eunit | ||
.PHONY: eunit | ||
|
||
## Checks | ||
|
||
xref: | ||
@rebar3 xref | ||
.PHONY: xref | ||
|
||
hank-dead-code-cleaner: | ||
@if rebar3 plugins list | grep '^rebar3_hank\>' >/dev/null; then \ | ||
rebar3 hank; \ | ||
else \ | ||
echo >&2 "WARN: skipping rebar3_hank check"; \ | ||
fi | ||
.PHONY: hank-dead-code-cleaner | ||
|
||
elvis-linter: | ||
@rebar3 lint | ||
@if rebar3 plugins list | grep '^rebar3_lint\>' >/dev/null; then \ | ||
rebar3 lint; \ | ||
else \ | ||
echo >&2 "WARN: skipping rebar3_lint check"; \ | ||
fi | ||
.PHONY: elvis-linter | ||
|
||
dialyzer: | ||
@rebar3 dialyzer | ||
.PHONY: dialyzer | ||
|
||
eqwalizer: | ||
@rebar3 as eqwalizer,test compile | ||
elp eqwalize-all | ||
|
||
test: cli | ||
@rebar3 do eunit, ct, cover | ||
./locus check --log-level debug test/priv/GeoLite2-Country.tar.gz | ||
|
||
cover: test | ||
## Shell, docs and publication | ||
|
||
shell: export ERL_FLAGS = +pc unicode | ||
shell: | ||
@rebar3 as shell shell | ||
|
||
console: shell | ||
cli: | ||
@rebar3 as escriptize escriptize | ||
cp -p "$(CLI_ARTIFACT_PATH)" ./ | ||
|
||
doc-dry: | ||
@rebar3 hex build | ||
.PHONY: doc-dry | ||
|
||
publish: | ||
publish: doc | ||
@rebar3 hex publish | ||
|
||
cli: | ||
@rebar3 as escriptize escriptize | ||
cp -p "$(CLI_ARTIFACT_PATH)" ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters