2012-02-02 17:11:45 +00:00
|
|
|
|
2012-02-08 18:05:56 +00:00
|
|
|
#---- Tools
|
|
|
|
|
|
|
|
TAP := ./node_modules/.bin/tap
|
|
|
|
|
|
|
|
|
2012-02-10 08:14:33 +00:00
|
|
|
#---- Files
|
|
|
|
|
|
|
|
JSSTYLE_FILES := $(shell find lib test tools -name *.js)
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-08 18:05:56 +00:00
|
|
|
#---- Targets
|
|
|
|
|
2012-02-02 17:11:45 +00:00
|
|
|
all:
|
|
|
|
|
2012-02-08 18:05:56 +00:00
|
|
|
# Ensure all version-carrying files have the same version.
|
|
|
|
.PHONY: versioncheck
|
2012-02-02 17:11:45 +00:00
|
|
|
versioncheck:
|
|
|
|
[[ `cat package.json | json version` == `grep '^var VERSION' bin/bunyan | awk -F'"' '{print $$2}'` ]]
|
|
|
|
[[ `cat package.json | json version` == `grep '^var VERSION' lib/bunyan.js | awk -F'"' '{print $$2}'` ]]
|
|
|
|
@echo Version check ok.
|
|
|
|
|
2012-02-08 18:05:56 +00:00
|
|
|
.PHONY: cutarelease
|
2012-02-02 17:11:45 +00:00
|
|
|
cutarelease: versioncheck
|
2012-03-28 06:00:45 +00:00
|
|
|
[[ ! -d tmp ]] # No 'tmp/' allowed: https://github.com/isaacs/npm/issues/2144 (fixed in npm 1.1.12 / node 0.6.14 I think)
|
2012-02-02 23:49:23 +00:00
|
|
|
./tools/cutarelease.py -p bunyan -f package.json -f lib/bunyan.js -f bin/bunyan
|
2012-02-02 17:11:45 +00:00
|
|
|
|
2012-02-08 18:05:56 +00:00
|
|
|
.PHONY: test
|
|
|
|
test: $(TAP)
|
|
|
|
TAP=1 $(TAP) test/*.test.js
|
|
|
|
|
2012-02-10 08:14:33 +00:00
|
|
|
.PHONY: check-jsstyle
|
|
|
|
check-jsstyle: $(JSSTYLE_FILES)
|
|
|
|
./tools/jsstyle -o indent=2,doxygen,unparenthesized-return=0,blank-after-start-comment=0 $(JSSTYLE_FILES)
|
|
|
|
|
|
|
|
.PHONY: check
|
|
|
|
check: check-jsstyle
|
|
|
|
@echo "Check ok."
|
|
|
|
|
|
|
|
.PHONY: prepush
|
|
|
|
prepush: check test
|
|
|
|
@echo "Okay to push."
|