2014-02-27 22:44:53 +08:00
|
|
|
BIN := ./node_modules/.bin
|
2015-01-09 04:04:52 +08:00
|
|
|
FILES := $(shell find lib spec/lib examples -type f -name "*.js" | grep -v lodash)
|
2014-10-21 05:55:25 +08:00
|
|
|
TEST_FILES := spec/helper.js $(shell find spec/lib -type f -name "*.js")
|
2014-02-27 22:44:53 +08:00
|
|
|
|
2014-03-29 03:29:33 +08:00
|
|
|
VERSION := $(shell node -e "console.log(require('./package.json').version)")
|
|
|
|
|
2015-01-02 02:09:27 +08:00
|
|
|
.PHONY: default cover test bdd lint ci release
|
2014-05-22 10:35:09 +08:00
|
|
|
|
2015-01-02 02:09:27 +08:00
|
|
|
default: lint test
|
|
|
|
|
|
|
|
test:
|
2014-10-21 05:38:41 +08:00
|
|
|
@$(BIN)/mocha --colors -R dot $(TEST_FILES)
|
2014-02-27 22:44:53 +08:00
|
|
|
|
2015-01-02 02:09:27 +08:00
|
|
|
bdd:
|
2014-02-28 01:41:47 +08:00
|
|
|
@$(BIN)/mocha --colors -R spec $(TEST_FILES)
|
2014-02-27 22:44:53 +08:00
|
|
|
|
2014-06-05 07:01:47 +08:00
|
|
|
cover:
|
|
|
|
@istanbul cover $(BIN)/_mocha $(TEST_FILES) --report lcovonly -- -R spec
|
|
|
|
|
2014-02-27 22:44:53 +08:00
|
|
|
lint:
|
2014-12-16 03:29:57 +08:00
|
|
|
@jshint $(FILES)
|
|
|
|
|
|
|
|
ci: lint cover
|
2014-03-29 03:29:33 +08:00
|
|
|
|
2014-12-16 05:39:59 +08:00
|
|
|
release: lint test
|
2014-10-02 08:10:36 +08:00
|
|
|
@git push origin master
|
|
|
|
@git checkout release ; git merge master ; git push ; git checkout master
|
2014-03-29 03:29:33 +08:00
|
|
|
@git tag -m "$(VERSION)" v$(VERSION)
|
|
|
|
@git push --tags
|
|
|
|
@npm publish ./
|