-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
148 lines (120 loc) · 3.18 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
144
145
146
147
148
# OS detection adapted from: https://gist.github.com/sighingnow/deee806603ec9274fd47
OSFLAG :=
JLINK := $(shell command -v jlink 2> /dev/null)
LEIN := $(shell command -v lein 2> /dev/null)
SHADOW := $(shell command -v shadow-cljs 2> /dev/null)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
OSFLAG := -l
endif
ifeq ($(UNAME_S),Darwin)
OSFLAG := -m
endif
ifeq ($(UNAME_S),CYGWIN_NT-10.0)
OSFLAG := -w
endif
ifeq ($(UNAME_S),MSYS_NT-10.0)
OSFLAG := -w
endif
package: install package-only
deps-mac:
mkdir ./bin
deps-win:
choco install make -y
choco install lein -y
choco install nvm -y
choco install python2 -y
nvm install 12.8.1
nvm use 12.8.1
npm set progress=false
npm install -g windows-build-tools@4.0.0
npm install -g node-gyp
deps-ubuntu:
sudo apt-get update
sudo apt-get install python2.7
sudo apt-get install make
sudo apt-get install g++
sudo apt-get install icnsutils
sudo apt-get install graphicsmagick
sudo apt-get install libx11-dev
sudo apt-get install libxkbfile-dev
sudo apt-get install libgconf-2-4
npm install -g electron
npm install -g electron-cli
npm install -g electron-build-env
npm install -g node-gyp
npm install -g webpack
mkdir ./bin
clean:
@echo Cleaning up...
@rm -rf ./bin
@rm -rf ./dist
@lein clean
deps:
@echo Fetching Leiningen dependencies...
@lein deps
npm-deps:
@echo Fetching NPM dependencies...
@npm install
@npm install -g electron-builder
@npx electron-rebuild -v 13.1.7 -w keytar
test: deps cljs-test
@echo Running Clojure tests...
@lein test
nsorg:
@echo Optimizing Imports...
@lein nsorg --replace
@lein nsorg --replace src/cljs
@lein nsorg --replace MeinsApp/src
cljs-test: npm-deps
@echo Running ClojureScript tests...
@npx shadow-cljs compile shared-tests
@TZ=UTC node out/shared-tests.js
run-cljs-tests:
@TZ=UTC node out/shared-tests.js
watch-tests: npm-deps
@echo Running ClojureScript tests...
@npx shadow-cljs watch shared-tests
watch-renderer:
shadow-cljs watch renderer
watch-main:
shadow-cljs watch main
sass:
@echo Building CSS...
@lein sass4clj once
cljs: deps npm-deps
@echo Building ClojureScript for main electron process...
@npx shadow-cljs release main
@echo Building ClojureScript for electron renderer process...
@npx shadow-cljs release renderer
figwheel:
@lein cljs-figwheel
electron: deps test cljs-test sass cljs
directories:
@echo Preparing target directories...
@mkdir -p bin
@chmod -R +w bin/
@rm -rf ./dist
jlink: test directories
@echo Assembling UberJAR...
@lein jlink assemble
# replace symlinks, they lead to problems with electron-packager
# from: https://superuser.com/questions/303559/replace-symbolic-links-with-files
symlinks:
@echo Fixing symlinks...
tar -hcf - target/jlink | tar xf - -C bin/
rm -rf bin/jlink
mv bin/target/jlink/ bin/
chmod -R ugo+w bin/jlink/legal/
install: jlink symlinks electron
package-only:
@echo Building executable...
@npx electron-builder $(OSFLAG)
publish-github:
@echo Publishing to GitHub Releases - requires GH_TOKEN in ENV...
@npx electron-builder -c electron-builder.yml --publish always $(OSFLAG)
lint-classpath:
clj-kondo --lint "$$(shadow-cljs classpath)" || true
lint:
clj-kondo --lint src
release: clean install publish-github