forked from djblue/portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
143 lines (99 loc) · 2.9 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
export BABASHKA_CLASSPATH := $(shell clojure -A:test -Spath)
export PATH := $(PWD)/target:$(PATH)
SHELL := bash
VERSION := 0.7.0
.PHONY: dev test
all: dev
clean:
rm -rf target resources/portal/
target/install-clojure:
mkdir -p target
curl https://download.clojure.org/install/linux-install-1.10.1.727.sh -o target/install-clojure
chmod +x target/install-clojure
install/clojure: target/install-clojure
sudo ./target/install-clojure
install/chrome:
sudo apt-get update && sudo apt-get install -y chromium-browser
target/install-babashka:
mkdir -p target
curl -s https://raw.githubusercontent.com/borkdude/babashka/master/install -o target/install-babashka
chmod +x target/install-babashka
target/bb: target/install-babashka
target/install-babashka $(PWD)/target
touch target/bb
bb: target/bb
node_modules: package.json
npm ci
resources/portal/main.js: node_modules
clojure -M:cljs:shadow-cljs release client
resources/portal/ws.js: node_modules
npx browserify --node \
--exclude bufferutil \
--exclude utf-8-validate \
--standalone Server \
--outfile resources/portal/ws.js \
node_modules/ws
resources/js: resources/portal/main.js resources/portal/ws.js
dev: resources/js
clojure -M:dev:cider:cljs:dev-cljs:shadow-cljs watch client
dev/node: resources/js
clojure -M:dev:cider:cljs:dev-cljs:shadow-cljs watch node client
check/clj-check:
clojure -M:nrepl:check
check/clj-kondo:
clojure -M:kondo --lint dev src test
check/cljfmt:
clojure -M:cljfmt check
check/npm-deps:
npm outdated
fix/npm-deps:
npm update
check/clj-deps:
clojure -M:antq -m antq.core
fix/clj-deps:
clojure -M:antq -m antq.core --upgrade
check/deps: check/clj-deps check/npm-deps
lint: check/clj-check check/clj-kondo check/cljfmt
target:
mkdir -p target
test/jvm: resources/js target
clojure -M:test -m portal.test-runner
test/bb: resources/js bb
bb -m portal.test-runner
test: test/jvm test/bb
fmt:
clojure -M:cljfmt fix
ci: lint test
e2e/jvm: resources/js
@echo "running e2e tests for jvm"
@clojure -M:test -m portal.e2e | clojure -M -e "(set! *warn-on-reflection* true)" -r
e2e/node: resources/js
@echo "running e2e tests for node"
@clojure -M:test -m portal.e2e | clojure -M:cljs -m cljs.main -re node
e2e/bb: resources/js bb
@echo "running e2e tests for babashka"
@clojure -M:test -m portal.e2e | bb
e2e/web: resources/js
@echo "running e2e tests for web"
@echo "please wait for browser to open before proceeding"
@clojure -M:test -m portal.e2e web | clojure -M:cljs -m cljs.main
e2e: e2e/jvm e2e/node e2e/web e2e/bb
main/jvm:
cat deps.edn | clojure -m portal.main edn
main/bb:
cat deps.edn | bb -cp src:resources -m portal.main edn
demo: resources/js bb
./build-demo
set-version:
bb -cp dev -m version ${VERSION}
git add .
git commit -m "Release ${VERSION}"
pom.xml: deps.edn
clojure -Spom
jar: pom.xml resources/js
mvn package
install: jar
mvn install
release: clean ci jar
deploy: release
mvn deploy