-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
41 lines (33 loc) · 1.38 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
_FILES=$(shell git diff-files --quiet --ignore-submodules && true || echo '+')
_INDEX=$(shell git diff-index --cached --quiet HEAD && true || echo '+')
VERSION=$(shell git rev-parse HEAD)$(_FILES)$(_INDEX)
all: tar
rjs: deps _rjs
tar: rjs _tar
test: tar _test
deps:
yarn install
_rjs:
rm -rf _build
node_modules/requirejs/bin/r.js -o build.js
# r.js removeCombined option doesn't handle plugin resources
rm -r _build/src/exclude.js _build/src/templates _build/src/less-style
find _build/ -maxdepth 1 -mindepth 1 -not -name src -not -name lib -not -name README.md -not -name node_modules | xargs rm -rf
# https://github.com/guybedford/require-css/issues/133
cd _build/node_modules && ls . | xargs rm -r
mkdir -p _build/node_modules/jstree/dist/themes/default
cp node_modules/jstree/dist/themes/default/*.png \
node_modules/jstree/dist/themes/default/*.gif \
_build/node_modules/jstree/dist/themes/default
# combine CSS files (and adjust location for relative image paths)
cat _build/src/local-deps.css _build/src/main-components.css > _build/style.css
rm _build/src/local-deps.css _build/src/main-components.css
mv _build/src/images _build/
echo "$(VERSION)" > _build/version.txt
(yarn list || yarn list --offline) | grep -Ev "^(Vellum|yarn) " > _build/manifest.txt
python buildmain.py > _build/src/main.js
_tar:
rm -f vellum.tar.gz
tar -czf vellum.tar.gz -C _build .
_test:
npm test