forked from remotestorage/remotestorage.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
75 lines (53 loc) · 1.7 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
DOC_BIN=naturaldocs
DOC_DIR=./doc/code
DOC_CONFIG_DIR=./doc/config
DOC_CUSTOM_CSS=custom-1
SOURCE_DIR=./src
ASSETS_DIR=./assets
ASSETS_OUT=$(SOURCE_DIR)/lib/assets.js
DOC_INPUTS=-i $(SOURCE_DIR) -i ./doc/pages/
NODEJS=node
VERSION ?= $(shell cat VERSION)
default: debug-only
build:
cd build/ && $(NODEJS) build.js
debug-only:
cd build/ && $(NODEJS) build.js debug
prepare-gh-pages:
git checkout gh-pages
git merge master
push-gh-pages:
git push origin gh-pages
commit-build: prepare-gh-pages build
git add build/
git commit -m "build: `date -u`"
git checkout master
commit-docs: prepare-gh-pages doc
git add $(DOC_DIR) $(DOC_CONFIG_DIR)
git commit -m "doc build: `date -u`"
git checkout master
push-build: commit-build push-gh-pages
push-docs: commit-docs push-gh-pages
doc:
mkdir -p $(DOC_DIR) $(DOC_CONFIG_DIR)
$(DOC_BIN) $(DOC_INPUTS) -o html $(DOC_DIR) -p $(DOC_CONFIG_DIR) -s Default $(DOC_CUSTOM_CSS)
clean-doc:
rm -rf $(DOC_DIR) $(DOC_CONFIG_DIR)/Data
compile-assets: $(ASSETS_DIR)/*
$(NODEJS) build/compile-assets.js $(ASSETS_DIR) $(ASSETS_OUT)
.PHONY: doc clean-doc build commit-build push-build prepare-gh-pages compile-assets release test
test:
npm test
snapshot:
make release VERSION=`git log -n1 | head -n1 | sed -r 's/commit (\w{8}).*/\1/'`
release: build
rm -rf release/$(VERSION)
cp -r build/latest release/$(VERSION)
node build/update-version.js component.json $(VERSION) > component.json.tmp
mv component.json.tmp component.json
node build/update-version.js package.json $(VERSION) > package.json.tmp
mv package.json.tmp package.json
commit-release: release
git add release/$(VERSION) component.json package.json
git commit -m "Release build: $(VERSION)"
git tag v$(VERSION)