-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
83 lines (57 loc) · 1.48 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
82
83
VERSION = $(shell cat package.json | sed -n 's/.*"version": "\([^"]*\)",/\1/p')
SHELL = /usr/bin/env bash
default: build
.PHONY: test build rollup rollup_min clean build_full docs
version:
@echo $(VERSION)
install:
npm install
npm i -D canvg
test:
$$(npm bin)/karma start
MINIFIED=true $$(npm bin)/karma start
build_full: clean rollup_canvg rollup_html2canvas build
build: rollup rollup_min
rollup:
$$(npm bin)/rollup -c
cp dist/ig_screenshot.js docs/ig_screenshot.js
run:
$$(npm bin)/serve docs
docs:
node generate_docs.js
rollup_min:
MINIFY=true $$(npm bin)/rollup -c
rollup_canvg:
CANVG=true $$(npm bin)/rollup -c
rollup_html2canvas:
HTML2CANVAS=true $$(npm bin)/rollup -c
clean:
@rm -rf src/html2canvas.js
@rm -rf src/canvg.js
remove_tag:
ifeq ($(t),)
$(error you must specify a "t" parameter. e.g. make remove_tag t=v1.0.0)
endif
@git tag -d $(t)
@git push origin :refs/tags/$(t)
update_version:
ifeq ($(shell expr "${VERSION}" \> "$(v)"),1)
$(error "v" parameter is lower than current version ${VERSION})
endif
ifeq ($(v),)
$(error v is undefined)
endif
ifeq (${VERSION},$(v))
$(error v is already the current version)
endif
@echo "Current version is " ${VERSION}
@echo "Next version is " $(v)
sed -i s/'"version": "$(VERSION)"'/'"version": "$(v)"'/g package.json
tag_and_push:
git add --all
git commit -a -m "Tag v $(v) $(m)"
git tag v$(v)
git push
git push --tags
tag: build docs test release
release: test update_version tag_and_push