-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
88 lines (73 loc) · 2.14 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
# Run hg purge & git clean, but exclude secrets and other dev env files
clean:
hg purge --all \
--exclude 'secrets*.py' \
--exclude '.tags*' \
--exclude 'deploy/node_modules'
cd khan-exercises && git clean -xdf
# Install dependencies required for development.
install_deps:
pip install -r requirements.txt
# Attempt to update (abort if uncommitted changes found).
safeupdate:
hg pull
hg update -c
# Update to the latest source and installed dependencies.
# Run this as a cron job to keep your source tree up-to-date.
refresh: safeupdate install_deps ;
# Run tests. If COVERAGE is set, run them in coverage mode. If
# MAX_TEST_SIZE is set, only tests of this size or smaller are run.
MAX_TEST_SIZE = medium
COVERAGE_OMIT = *_test.py
COVERAGE_OMIT += */google_appengine/*
COVERAGE_OMIT += third_party/*
COVERAGE_OMIT += api/packages/*
COVERAGE_OMIT += asynctools/*
COVERAGE_OMIT += atom/*
COVERAGE_OMIT += gdata/*
COVERAGE_OMIT += jinja2/*
COVERAGE_OMIT += mapreduce/*
COVERAGE_OMIT += tools/*
COVERAGE_OMIT += webapp2.py
COVERAGE_OMIT += webapp2_extras/*
test:
if test -n "$(COVERAGE)"; then \
coverage run --omit="`echo '$(COVERAGE_OMIT)' | tr ' ' ,`" \
tools/runtests.py --max-size="$(MAX_TEST_SIZE)" --xml && \
coverage xml && \
coverage html; \
else \
python tools/runtests.py --max-size="$(MAX_TEST_SIZE)"; \
fi
# Run lint checks
lint:
tools/runpep8.py
# Run unit tests with XML test and code coverage reports
# Run the tests we want to run before committing. Once you've run
# these, you can be confident (well, more confident) the commit is a
# good idea.
check: lint test ;
# Run the subset of tests that are fast
quickcheck:
$(MAKE) MAX_TEST_SIZE=small check
# Run *all* the tests
allcheck:
$(MAKE) MAX_TEST_SIZE=large check
# Compile handlebars templates
handlebars:
python deploy/compile_handlebar_templates.py
# Compile jinja templates
jinja:
python deploy/compile_templates.py
# Pack exercise files
exercises:
ruby khan-exercises/build/pack.rb
# Compress javascript
js:
python deploy/compress.py js
# Compress css
css:
python deploy/compress.py css
# Package less stylesheets
less:
python deploy/compile_less.py