forked from naturalatlas/node-gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
81 lines (67 loc) · 2.13 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
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
72
73
74
75
76
77
78
79
80
81
.PHONY: clean clean-test build rebuild release test test-concurrent test-syntax authors
MOCHA_ARGS=test -R list -gc --require ./test/_common.js
all: build
authors:
git shortlog -se \
| perl -spe 's/^\s+\d+\s+//' \
| sed -e '/^BrandonReavis/d' \
| sed -e '/brianreavis/d' \
| sed -e '/^brandonreavis/d' \
> AUTHORS
echo "Zac McCormick <[email protected]>" >> AUTHORS
clean: clean-test
@rm -rf ./build
@rm -rf lib/binding
clean-test:
@rm -f ./test/**/*.aux.xml
@rm -rf ./test/**/*.tmp*
@rm -rf ./test/data/**/*.tmp*
./node_modules/.bin/node-pre-gyp:
npm install node-pre-gyp
build: ./node_modules/.bin/node-pre-gyp
./node_modules/.bin/node-pre-gyp configure --enable-logging=true
./node_modules/.bin/node-pre-gyp build
build-shared: ./node_modules/.bin/node-pre-gyp
./node_modules/.bin/node-pre-gyp configure --enable-logging=true --shared_gdal=true
./node_modules/.bin/node-pre-gyp build
rebuild:
@make clean
@make
test: clean-test build
./node_modules/.bin/mocha $(MOCHA_ARGS)
@make clean-test
test-shared: clean-test build-shared
./node_modules/.bin/mocha $(MOCHA_ARGS)
@make clean-test
test-syntax:
npm run test-syntax
test-concurrent: clean-test
node ./node_modules/.bin/_mocha \
& node ./node_modules/.bin/_mocha \
& node ./node_modules/.bin/_mocha \
& node ./node_modules/.bin/_mocha \
& node ./node_modules/.bin/_mocha \
& node ./node_modules/.bin/_mocha
@make clean-test
release:
ifeq ($(strip $(version)),)
@echo "\033[31mERROR:\033[0;39m No version provided."
@echo "\033[1;30mmake release version=1.0.0\033[0;39m"
else
rm -rf node_modules
npm install
make test
@make authors
sed -i.bak 's/"version": "[^"]*"/"version": "$(version)"/' package.json
sed -i.bak 's/"version": "[^"]*"/"version": "$(version)"/' package-lock.json
sed -i.bak 's/"version": "[^"]*"/"version": "$(version)"/' yuidoc.json
rm *.bak
git add .
git commit --allow-empty -a -m "Released $(version). [publish binary]"
git tag v$(version)
git push origin master
git push origin --tags
@echo "\033[32mv${version} tagged\033[0;39m"
@echo ""
@echo "IMPORTANT: Run 'npm publish' once Travis/AppVeyor complete their builds"
endif