-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
198 lines (162 loc) · 4.51 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
default: build
PACKAGES := node_modules/.packages.build
SEMANTIC := semantic/dist/.semantic.build
BOWER := components/.bower.build
GRUNT := dist/.grunt.build
BUILD := dist/build.json
QUILL_SYMLINK := stylesheets/_quill.scss
OEMBED_SYMLINK := stylesheets/_oembed.scss
SYMLINKS := $(QUILL_SYMLINK) $(OEMBED_SYMLINK)
export ATLAS_URL ?= https://atlas-dev.forsta.io
export ATLAS_UI_URL ?= https://app-dev.forsta.io
export SIGNAL_URL ?= https://signal-dev.forsta.io
export HAS_AVATAR_SERVICE ?= 1
export RESET_CACHE ?= 1
export NO_MINIFY ?= 1
export MORGAN_LOGGING ?= dev
packages: $(PACKAGES)
semantic: $(SEMANTIC)
bower: $(BOWER)
grunt: $(GRUNT)
NPATH := $(shell pwd)/node_modules/.bin
SRC := $(shell find app lib stylesheets -type f 2>/dev/null)
########################################################
# Building & cleaning targets
########################################################
$(PACKAGES): package.json
npm install
touch $@
$(SEMANTIC): $(PACKAGES) $(shell find semantic/src semantic/tasks -type f 2>/dev/null)
cd semantic && $(NPATH)/gulp build
touch $@
$(BOWER): $(PACKAGES) bower.json Makefile
if [ -n "$$GITHUB_AUTH_TOKEN" ] ; then \
git config --global credential.helper "$$PWD/.heroku_env_auth"; \
fi
$(NPATH)/bower --allow-root install
touch $@
$(QUILL_SYMLINK):
ln -sf ../node_modules/quill/dist/quill.snow.css $@
$(OEMBED_SYMLINK):
ln -sf ../components/jquery-oembed-all/jquery.oembed.css $@
OEMBED_SYMLINK := stylesheets/_oembed.scss
$(GRUNT): $(BOWER) $(SEMANTIC) $(SYMLINKS) Gruntfile.js $(SRC) Makefile
$(NPATH)/grunt default
touch $@
$(BUILD): $(GRUNT) Makefile
echo '{"git_commit": "$(or $(SOURCE_VERSION),$(shell git rev-parse HEAD))"}' > $@
clean:
rm -rf $(PACKAGES) $(SEMANTIC) $(BOWER) $(GRUNT) dist builds
realclean: clean
rm -rf node_modules components $(SYMLINKS)
build: $(BUILD)
lint:
$(NPATH)/eslint app lib worker tests
test:
node tests/forstaDownTest.js
npm test
test-debug:
node tests/forstaDownTest.js
npm run test-debug
test-debug-node:
node tests/forstaDownTest.js
npm run test-debug-node
ci: $(BUILD)
npm install --only=dev
$(MAKE) lint
$(MAKE) test
########################################################
# Runtime-only targets
########################################################
watch:
$(NPATH)/grunt watch
run: $(BUILD)
node server/start.js
forcerun:
node server/start.js
run-electron: $(BUILD)
$(NPATH)/electron .
ELECTRON_IGNORES := \
--ignore '^/.bowerrc' \
--ignore '^/.buildpacks' \
--ignore '^/.github' \
--ignore '^/.gitignore' \
--ignore '^/.npmrc' \
--ignore '^/.sass-cache' \
--ignore '^/.slugignore' \
--ignore '^/Gemfile.*' \
--ignore '^/Gruntfile.js.json' \
--ignore '^/Makefile' \
--ignore '^/Procfile' \
--ignore '^/app' \
--ignore '^/audio' \
--ignore '^/bower.json' \
--ignore '^/build' \
--ignore '^/components' \
--ignore '^/fonts' \
--ignore '^/html' \
--ignore '^/images' \
--ignore '^/lib' \
--ignore '^/references' \
--ignore '^/semantic' \
--ignore '^/semantic.json' \
--ignore '^/stylesheets' \
--ignore '^/templates' \
--ignore '^/tests' \
--ignore '^/worker' \
--ignore '^/node_modules/semantic-ui' \
--ignore '^/node_modules/librelay-web' \
--ignore '^/node_modules/libsignal-protocol' \
--ignore '^/node_modules/bower' \
--ignore '^/node_modules/.*emoji.*'
electron:
$(NPATH)/electron-packager . \
--overwrite \
--icon images/$$([ "$(shell uname)" == "Darwin" ] && echo images/app.icns || echo app.png) \
--out builds \
--appBundleId io.forsta.messenger \
$(ELECTRON_IGNORES)
electron-win32:
$(NPATH)/electron-packager . \
--overwrite \
--platform win32 \
--icon electron/windowsAssets/app.ico \
--out builds \
--arch x64 \
--asar \
$(ELECTRON_IGNORES)
electron-darwin:
$(NPATH)/electron-packager . \
--overwrite \
--platform darwin \
--icon images/app.icns \
--out builds \
--appBundleId io.forsta.messenger \
$(ELECTRON_IGNORES)
electron-mas:
$(NPATH)/electron-packager . \
--overwrite \
--platform mas \
--prune true\
--icon images/app.icns \
--asar \
--arch x64 \
--out builds \
--appBundleId io.forsta.messenger \
$(ELECTRON_IGNORES)
electron-linux:
$(NPATH)/electron-packager . \
--overwrite \
--platform linux \
--icon images/app.png \
--out builds \
$(ELECTRON_IGNORES)
electron-osx-sign:
electron/sign_mas.sh
docker-build:
docker build -t relay-web-app .
docker-ci:
docker build --build-arg build_target=ci -t relay-web-app .
docker-run:
docker run -it -p 1080:1080 relay-web-app
.PHONY: electron docker-build docker-run test test-debug test-debug-node lint