-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
66 lines (51 loc) · 1.42 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
SBT = sbt
OPEN = open
PYTHON = python3
APP_NAME = mog-playground
PROD_RSC = docs
TEST_ASS = assets
PROD_ASS = ${PROD_RSC}/assets
DEV_PORT = 8000
COPY_PROD = cp -f target/scala-2.13/${APP_NAME}-opt.js ${PROD_ASS}/js/ && cp -rf ${TEST_ASS}/* ${PROD_ASS}/
REMOVE_MAPPING = sed -i '' -e '/\/\/\# sourceMappingURL.*/d' ${PROD_ASS}/js/${APP_NAME}-opt.js
UGLIFY_CSS = rm -f ${PROD_ASS}/css/* && uglifycss ${TEST_ASS}/css/[bmps]* > ${PROD_ASS}/css/pg.min.css && uglifycss ${TEST_ASS}/css/notesview.css > ${PROD_ASS}/css/notesview.css
build: sync_frontend_assets
${SBT} fastOptJS
test:
${SBT} test
console:
${SBT} test:console
clean:
rm -rf ~/.sbt/1.0/staging/*/mog-*
${SBT} clean
local:
${OPEN} http://localhost:${DEV_PORT}/index-dev-debug.html?debug=true
local-prod:
${OPEN} http://localhost:${DEV_PORT}/
server:
${PYTHON} -m 'http.server' ${DEV_PORT}
server-prod:
cd docs && ${PYTHON} -m 'http.server' ${DEV_PORT}
sync_frontend_assets:
cp -rf ../mog-frontend/assets .
rm -f assets/js/bootstrap.js
publish: sync_frontend_assets clean test
sbt fullOptJS
${COPY_PROD}
${REMOVE_MAPPING}
${UGLIFY_CSS}
publish-commit: publish
git add .
git commit -m Publish
git push
publish-assets:
${COPY_PROD}
${REMOVE_MAPPING}
${UGLIFY_CSS}
merge:
git checkout master
git pull
git checkout develop
git merge master
git push
.PHONY: build test console clean local local-prod server server-prod publish publish-commit publish-assets merge