forked from reagent-project/reagent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
79 lines (57 loc) · 1.53 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
PORT = 4562
PROF = dev
# PROF = prod,srcmap
# PROF = prod
CLJSBUILD = client
CLJSDIRS = src test
VERSION = 0.4.3
REACT_VERSION = 0.12.1
all: buildrun
run: openbrowser buildrun
leinbuild: setup
lein -o with-profile $(PROF) cljsbuild once $(CLJSBUILD)
openbrowser:
(sleep 1 && open site/test.html) &
buildrun: setup
lein -o with-profile $(PROF) cljsbuild auto $(CLJSBUILD)
runtest:
$(MAKE) run PROF=test,$(PROF)
runsite: setup
(sleep 3 && open "http://127.0.0.1:$(PORT)/$$(basename $$PWD)") &
( trap "kill 0" SIGINT SIGTERM EXIT; \
( cd .. && python -m SimpleHTTPServer $(PORT) & ); \
lein -o with-profile $(PROF),prod cljsbuild auto $(CLJSBUILD) )
install: leinbuild
lein install
preclean:
rm -rf repl .repl target out
mkdir -p vendor/reagent
clean: preclean
rm -rf news assets
lein -o clean
setup: preclean
mkdir -p news assets
show-outdated:
lein ancient :all
download-react:
curl -L "http://fb.me/react-$(REACT_VERSION).js" \
-o vendor/reagent/react.js
curl -L "http://fb.me/react-$(REACT_VERSION).min.js" \
-o vendor/reagent/react.min.js
gensite:
node bin/gen-site.js
demobuild:
$(MAKE) PROF=prod,demo leinbuild
buildsite: demobuild gensite
setversion:
version=$(VERSION); \
find . -name project.clj -o -name README.md | \
xargs -n1 sed -i "" -e 's,\(reagent "\)\([^"]*\)",\1'"$$version"'"',g
tag: setversion
if git rev-parse v$(VERSION) 2>/dev/null; then \
echo "Tag already exists"; \
exit 1; \
else \
git commit --allow-empty -a -v -e -m"Version "$(VERSION) && \
git tag v$(VERSION); \
fi