-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
77 lines (59 loc) · 1.92 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
EMACS ?= emacs
CASK ?= cask
SRC ?= web-beautify.el
TEST_CHECKDOC_EL ?= test/test-checkdoc.el
TEST_PACKAGE_INSTALL_EL ?= test/test-package-install.el
LOADPATH = -L .
ELPA_DIR = $(shell EMACS=$(EMACS) $(CASK) package-directory)
INIT_PACKAGE_EL="(progn (require 'cask) (cask-initialize \".\"))"
.PHONY : test
test: test-checkdoc package-lint test-package-install unit-tests
.PHONY : travis-ci
travis-ci: print-deps package-lint test-package-install unit-tests
.PHONY : unit-tests
# `clean-elc` task needs to remove byte-compiled files to collect coverage by undercover.el.
unit-tests: clean-elc elpa
@echo "-- Running unit-tests --"
${CASK} exec ert-runner
.PHONY : clean-elpa
clean-elpa:
rm -rf .cask
.PHONY : clean-elc
clean-elc:
${CASK} clean-elc
.PHONY : clean
clean: clean-elpa clean-elc
.PHONY : print-deps
print-deps:
${EMACS} --version
@echo CASK=${CASK}
.PHONY : test-checkdoc
test-checkdoc: elpa
@echo "-- test ckeckdoc --"
$(CASK) exec $(EMACS) -batch -Q $(LOADPATH) -l $(TEST_CHECKDOC_EL) 2>&1 | tee /dev/tty | [ $$(wc -l) -gt 0 ] && exit 1 || exit 0
.PHONY : package-lint
package-lint: elpa
@echo "-- package lint --"
$(CASK) exec $(EMACS) -batch -Q --eval $(INIT_PACKAGE_EL) -l package-lint.el -f package-lint-batch-and-exit $(SRC)
.PHONY : test-package-install
test-package-install: elpa
@echo "-- test install package --"
$(CASK) exec $(EMACS) -batch -Q $(LOADPATH) -l $(TEST_PACKAGE_INSTALL_EL) 2>&1 | tee /dev/tty | grep Error && exit 1 || exit 0
.PHONY : elpa
elpa: $(ELPA_DIR)
$(ELPA_DIR): Cask
$(CASK) install
touch $@
.PHONY : check-coveralls-token
check-coveralls-token:
ifdef COVERALLS_REPO_TOKEN
@true
else
@echo COVERALLS_REPO_TOKEN is undefined
@false
endif
.PHONY : clean-coveralls-report
clean-coveralls-report: check-coveralls-token
@( [ -f /tmp/undercover_coveralls_report ] && rm /tmp/undercover_coveralls_report ) || :
.PHONY : coveralls
coveralls: clean-coveralls-report unit-tests