-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
83 lines (66 loc) · 2.71 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
STATIC_DIR = ./scribbler/static/scribbler
PROJECT_FILES = ${STATIC_DIR}/js/scribbler-main.js ${STATIC_DIR}/js/scribbler-editor.js ${STATIC_DIR}/js/scribbler-menu.js ${STATIC_DIR}/js/djangohint.js
TESTS_DIR = ./scribbler/tests/qunit
TEST_FILES = ${TESTS_DIR}/menu-test.js ${TESTS_DIR}/editor-test.js
fetch-static-libs: FORCE
# Fetch JS library dependencies
# Requires npm
npm install
npm update
FORCE:
${STATIC_DIR}/css/scribbler.css: ${STATIC_DIR}/less/scribbler.less fetch-static-libs
# Build CSS from LESS
# Requires LESS
mkdir -p ${STATIC_DIR}/css
echo | node_modules/.bin/lessc -x node_modules/codemirror/lib/codemirror.css > $@
echo $^ $@
echo | node_modules/.bin/lessc ${STATIC_DIR}/less/scribbler.less >> $@
build-css: ${STATIC_DIR}/css/scribbler.css
lint-js: fetch-static-libs
# Check JS for any problems
node_modules/.bin/jshint ${STATIC_DIR}/js/djangohint.js
node_modules/.bin/jshint ${STATIC_DIR}/js/scribbler-main.js
node_modules/.bin/jshint ${STATIC_DIR}/js/scribbler-editor.js
node_modules/.bin/jshint ${STATIC_DIR}/js/scribbler-menu.js
node_modules/.bin/jshint ${STATIC_DIR}/js/plugins/
${STATIC_DIR}/js/scribbler.js: ${PROJECT_FILES}
node_modules/.bin/browserify $< -o $@
${STATIC_DIR}/js/scribbler-min.js: ${STATIC_DIR}/js/scribbler.js
node_modules/.bin/uglifyjs $^ -o $@
build-js: ${STATIC_DIR}/js/scribbler-min.js
${TESTS_DIR}/bundle.js: ${TESTS_DIR}/main.js ${PROJECT_FILES} ${TEST_FILES}
node_modules/.bin/browserify -t browserify-compile-templates --extension=.html $< -o $@
test-js: ${TESTS_DIR}/bundle.js
# Run the QUnit tests
# Requires PhantomJS
node_modules/.bin/phantomjs ${TESTS_DIR}/runner.js ${TESTS_DIR}/index.html
compile-messages:
# Create compiled .mo files for source distribution
cd scribbler && django-admin.py compilemessages
make-messages:
# Create .po message files
cd scribbler && django-admin.py makemessages -a && django-admin.py makemessages -d djangojs -a
push-messages: make-messages
# Create messages and push them to Transifex
# Requires Transifex client
tx push -s -t
pull-messages:
# Pull the latest translations from Transifex
# Requires Transifex client
tx pull -a
prep-release: lint-js build-css build-js pull-messages compile-messages
# Prepare for upcoming release
# Check JS, create CSS, compile translations, run the test suite
tox
dist: clean fetch-static-libs lint-js build-js build-css
python setup.py sdist
clean:
rm -f ${STATIC_DIR}/js/scribbler.js
rm -f ${STATIC_DIR}/js/scribbler-min.js
rm -rf ${STATIC_DIR}/css
rm -f ${TESTS_DIR}/bundle.js
rm -rf example/example/static/
rm -rf dist
rm -rf .tox
rm -rf node_modules
.PHONY: build-css build-js lint-js test-js compile-messages make-messages push-messages pull-messages prep-release dist clean