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
|
|
|
|
|
2012-08-09 16:10:28 +00:00
|
|
|
JSSTYLE_FILES := $(shell find lib test tools examples -name "*.js") bin/bunyan
|
2012-02-10 08:14:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
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:
|
2012-08-13 23:43:32 +00:00
|
|
|
[[ `cat package.json | json version` == `grep '^## ' CHANGES.md | head -1 | awk '{print $$3}'` ]]
|
2012-02-02 17:11:45 +00:00
|
|
|
[[ `cat package.json | json version` == `grep '^var VERSION' bin/bunyan | awk -F'"' '{print $$2}'` ]]
|
2012-06-05 06:22:39 +00:00
|
|
|
[[ `cat package.json | json version` == `grep '^var VERSION' lib/bunyan.js | awk -F"'" '{print $$2}'` ]]
|
2012-02-02 17:11:45 +00:00
|
|
|
@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-04-10 22:11:55 +00:00
|
|
|
|
|
|
|
#---- test
|
|
|
|
|
2012-02-08 18:05:56 +00:00
|
|
|
.PHONY: test
|
|
|
|
test: $(TAP)
|
|
|
|
TAP=1 $(TAP) test/*.test.js
|
|
|
|
|
2012-04-10 22:11:55 +00:00
|
|
|
# Test will all node supported versions (presumes install locations I use on my machine).
|
|
|
|
.PHONY: testall
|
2012-08-21 18:04:33 +00:00
|
|
|
testall: test08 test06 test09 testmaster
|
2012-04-10 22:11:55 +00:00
|
|
|
|
|
|
|
.PHONY: testmaster
|
|
|
|
testmaster:
|
|
|
|
@echo "# Test node master (with node `$(HOME)/opt/node-master/bin/node --version`)"
|
|
|
|
PATH="$(HOME)/opt/node-master/bin:$(PATH)" TAP=1 $(TAP) test/*.test.js
|
2012-08-21 18:04:33 +00:00
|
|
|
.PHONY: test09
|
|
|
|
test09:
|
|
|
|
@echo "# Test node 0.9.x (with node `$(HOME)/opt/node-0.9/bin/node --version`)"
|
|
|
|
PATH="$(HOME)/opt/node-0.9/bin:$(PATH)" TAP=1 $(TAP) test/*.test.js
|
|
|
|
.PHONY: test08
|
|
|
|
test08:
|
|
|
|
@echo "# Test node 0.8.x (with node `$(HOME)/opt/node-0.8/bin/node --version`)"
|
|
|
|
PATH="$(HOME)/opt/node-0.8/bin:$(PATH)" TAP=1 $(TAP) test/*.test.js
|
2012-04-10 22:11:55 +00:00
|
|
|
.PHONY: test06
|
|
|
|
test06:
|
|
|
|
@echo "# Test node 0.6.x (with node `$(HOME)/opt/node-0.6/bin/node --version`)"
|
|
|
|
PATH="$(HOME)/opt/node-0.6/bin:$(PATH)" TAP=1 $(TAP) test/*.test.js
|
|
|
|
|
|
|
|
|
2012-08-21 18:04:33 +00:00
|
|
|
|
2012-04-10 22:11:55 +00:00
|
|
|
#---- check
|
|
|
|
|
2012-02-10 08:14:33 +00:00
|
|
|
.PHONY: check-jsstyle
|
|
|
|
check-jsstyle: $(JSSTYLE_FILES)
|
2012-04-28 00:40:56 +00:00
|
|
|
./tools/jsstyle -o indent=2,doxygen,unparenthesized-return=0,blank-after-start-comment=0,leading-right-paren-ok $(JSSTYLE_FILES)
|
2012-02-10 08:14:33 +00:00
|
|
|
|
|
|
|
.PHONY: check
|
|
|
|
check: check-jsstyle
|
|
|
|
@echo "Check ok."
|
|
|
|
|
|
|
|
.PHONY: prepush
|
2012-04-28 00:40:56 +00:00
|
|
|
prepush: check testall
|
2012-02-10 08:14:33 +00:00
|
|
|
@echo "Okay to push."
|