forked from matthiasn/lotti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
145 lines (121 loc) · 3.25 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
# 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:
npm install -g electron-rebuild
npm install -g electron-builder
npm install -g shadow-cljs
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 shadow-cljs
npm install -g windows-build-tools@4.0.0
npm install -g node-gyp
npm install -g electron-builder
npm install -g electron-rebuild
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-builder
npm install -g electron-cli
npm install -g electron-build-env
npm install -g electron-rebuild
npm install -g node-gyp
npm install -g webpack
npm install -g shadow-cljs
mkdir ./bin
clean:
@echo Cleaning up...
@rm -rf ./bin
@rm -rf ./dist
@lein clean
@rm -f ./package-lock.json
deps: clean
@echo Fetching Leiningen dependencies...
@lein deps
npm-deps: clean
@echo Fetching NPM dependencies...
@npm install
@npm install -g electron-builder
@electron-rebuild -v 7.1.3 -w keytar
test: deps
@echo Running Clojure tests...
@lein test
nsorg:
@echo Optimizing Imports...
@lein nsorg --replace
@lein nsorg --replace src/cljs
@lein nsorg --replace MeinsApp/src
cljs-shared-tests: npm-deps
@echo Running ClojureScript tests...
@shadow-cljs compile shared-tests
@node out/shared-tests.js
sass:
@echo Building CSS...
@lein sass4clj once
cljs: deps npm-deps
@echo Building ClojureScript for main electron process...
@shadow-cljs release main
@echo Building ClojureScript for electron renderer process...
@shadow-cljs release renderer
figwheel:
@lein cljs-figwheel
electron: clean deps test cljs-shared-tests sass cljs
directories:
@echo Preparing target directories...
@mkdir -p bin
@chmod -R +w bin/
@rm -rf ./dist
jlink: clean 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 electron symlinks
package-only:
@echo Building executable...
@electron-builder $(OSFLAG)
publish-github:
@echo Publishing to GitHub Releases - requires GH_TOKEN in ENV...
@electron-builder -c electron-builder.yml --publish always $(OSFLAG)
lint-classpath:
clj-kondo --lint "$$(shadow-cljs classpath)" || true
lint:
clj-kondo --lint src
release: install publish-github