Skip to content

Instantly share code, notes, and snippets.

@localshred
Last active January 30, 2016 14:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save localshred/7ebd7dc2a2be35d6b595 to your computer and use it in GitHub Desktop.
Save localshred/7ebd7dc2a2be35d6b595 to your computer and use it in GitHub Desktop.
Makefile useful in an Elixir project that uses watchman-make for fun and profit.
SHA = "HEAD"
WATCH_TARGET = "test"
ifdef sha
SHA = $(sha)
endif
ifdef t
WATCH_TARGET = $(t)
endif
all: warnings dogma test
compile:
mix compile --warnings-as-errors
dialyzer: compile
mix dialyzer
dogma:
mix dogma --format=flycheck
stage-release:
./script/release.sh stage $(SHA)
prod-release:
./script/release.sh prod $(SHA)
test:
mix test $(testargs)
warnings:
mix compile --force --warnings-as-errors
# See https://facebook.github.io/watchman/docs/watchman-make.html
watch:
watchman-make -p 'lib/**/*.ex' 'test/**/*.exs' 'test/data/test_cases/*.json' 'config/*.exs' -t $(WATCH_TARGET)
.PHONY: all compile dialyzer dogma stage-release prod-release test warnings watch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment