-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
40 lines (33 loc) · 1.03 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
PATH := ${PATH}:./node_modules/.bin
build: lint test dist/knockout-transformations.min.js
.PHONY: lint
lint:
@jshint lib/*.js test/*.js
@jscs lib/*.js test/*.js
.PHONY: test
test:
@mocha
dist/knockout-transformations.js: package.json lib/*
@(echo '/*!' &&\
cat LICENSE &&\
echo '\n*/' &&\
cat lib/map.js &&\
cat lib/filter.js &&\
cat lib/sortBy.js &&\
cat lib/indexBy.js) > $@
dist/knockout-transformations.min.js: dist/knockout-transformations.js
@(echo '/*!' &&\
cat LICENSE &&\
echo '\n*/' &&\
uglifyjs dist/knockout-transformations.js) > $@
.PHONY: git-dirty-check
git-dirty-check:
ifneq ($(shell git describe --always --dirty | grep -- -dirty),)
$(error Working tree is dirty, please commit or stash your changes, then try again)
endif
.PHONY: release-%
release-%: git-dirty-check lint test dist/knockout-transformations.min.js
git add dist/knockout-transformations*.js && git commit -m "Build distribution files"
npm version $*
@echo $* release ready to be publised to NPM
@echo Remember to push tags