forked from openedx/edx-ora2
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
95 lines (72 loc) · 3.25 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
##################
# Install commands
##################
install-python:
pip install -r requirements/django.txt
pip install -r requirements/base.txt --only-binary=lxml,libsass
install-js:
npm install
install-test:
pip install -r requirements/test.txt
install: install-python install-js install-test javascript sass
##############################
# Generate js/css output files
##############################
STATIC_JS = openassessment/xblock/static/js
STATIC_CSS = openassessment/xblock/static/css
update-npm-requirements:
npm update --silent
cp ./node_modules/backgrid/lib/backgrid*.js $(STATIC_JS)/lib/backgrid/
cp ./node_modules/backgrid/lib/backgrid*.css $(STATIC_CSS)/lib/backgrid/
javascript: update-npm-requirements
node_modules/.bin/uglifyjs $(STATIC_JS)/src/oa_shared.js $(STATIC_JS)/src/*.js $(STATIC_JS)/src/lms/*.js $(STATIC_JS)/lib/backgrid/backgrid.min.js -c warnings=false > "$(STATIC_JS)/openassessment-lms.min.js"
node_modules/.bin/uglifyjs $(STATIC_JS)/src/oa_shared.js $(STATIC_JS)/src/*.js $(STATIC_JS)/src/studio/*.js $(STATIC_JS)/lib/backgrid/backgrid.min.js -c warnings=false > "$(STATIC_JS)/openassessment-studio.min.js"
sass:
python scripts/compile_sass.py
################
#Translations Handling
################
# creates the django-partial.po & django-partial.mo files
extract_translations:
python manage.py makemessages -l en -v1 --ignore=".tox/*" --ignore="build/*" --ignore="docs/*" --ignore="edx-ora2/*" --ignore="logs/*" --ignore="node_modules/*" --ignore="performance/*" --ignore="requirements/*" --ignore="scripts/*" --ignore="settings/*" --ignore="storage/*" -d django
python manage.py makemessages -l en -v1 --ignore=".tox/*" --ignore="build/*" --ignore="docs/*" --ignore="edx-ora2/*" --ignore="logs/*" --ignore="node_modules/*" --ignore="performance/*" --ignore="requirements/*" --ignore="scripts/*" --ignore="settings/*" --ignore="storage/*" -d djangojs
# compiles the *.po & *.mo files
compile_translations:
cd ./openassessment/ && i18n_tool generate -v && cd ..
# generate dummy translations
generate_dummy_translations:
i18n_tool dummy
# check if translation files are up-to-date
detect_changed_source_translations:
i18n_tool changed
# pull translations from Transifex
pull_translations:
cd ./openassessment/ && tx pull -af --mode reviewed --minimum-perc=1
# push source translation files (.po) to Transifex
push_translations:
tx push -s
# extract, compile, and check if translation files are up-to-date
validate_translations: extract_translations compile_translations generate_dummy_translations detect_changed_source_translations
################
#Tests and checks
################
quality:
./node_modules/.bin/jshint $(STATIC_JS)/src -c .jshintrc --verbose
./node_modules/jscs/bin/jscs $(STATIC_JS)/src --verbose
./scripts/run-pep8.sh
./scripts/run-pylint.sh
test-python:
coverage run manage.py test openassessment
render-templates:
./scripts/render-templates.sh
test-js: render-templates
./scripts/test-js.sh
test-js-debug: render-templates
./scripts/js-debugger.sh
test: quality test-python test-js
# acceptance and a11y tests require a functioning sandbox, and do not run on travis
test-acceptance:
./scripts/test-acceptance.sh tests
test-a11y:
./scripts/test-acceptance.sh accessibility
test-sandbox: test-acceptance test-a11y