Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 72 lines (49 sloc) 1.961 kb
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

#---- Tools

TAP := ./node_modules/.bin/tap


#---- Files

JSSTYLE_FILES := $(shell find lib test tools examples -name "*.js") bin/bunyan



#---- Targets

all:

# Ensure all version-carrying files have the same version.
.PHONY: versioncheck
versioncheck:
[[ `cat package.json | json version` == `grep '^## ' CHANGES.md | head -1 | awk '{print $$3}'` ]]
[[ `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.

.PHONY: cutarelease
cutarelease: versioncheck
./tools/cutarelease.py -p bunyan -f package.json -f lib/bunyan.js -f bin/bunyan


#---- test

.PHONY: test
test: $(TAP)
TAP=1 $(TAP) test/*.test.js

# Test will all node supported versions (presumes install locations I use on my machine).
.PHONY: testall
testall: test08 test06 test09 testmaster

.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
.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
.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



#---- check

.PHONY: check-jsstyle
check-jsstyle: $(JSSTYLE_FILES)
./tools/jsstyle -o indent=2,doxygen,unparenthesized-return=0,blank-after-start-comment=0,leading-right-paren-ok $(JSSTYLE_FILES)

.PHONY: check
check: check-jsstyle
@echo "Check ok."

.PHONY: prepush
prepush: check testall
@echo "Okay to push."
Something went wrong with that request. Please try again.