This repository has been archived by the owner on Apr 18, 2018. It is now read-only.
forked from translate/pootle
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
99 lines (81 loc) · 3.46 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
96
97
98
99
CWD = $(shell pwd)
SRC_DIR = ${CWD}/pootle
DOCS_DIR = ${CWD}/docs
STATIC_DIR = ${SRC_DIR}/static
ASSETS_DIR = $(shell python -c "from pootle.settings import *; print(STATIC_ROOT)")
JS_DIR = ${STATIC_DIR}/js
CSS_DIR = ${STATIC_DIR}/css
IMAGES_DIR = ${STATIC_DIR}/images
SPRITE_DIR = ${IMAGES_DIR}/sprite
FORMATS=--formats=bztar
TEST_ENV_NAME = pootle_test_env
.PHONY: all build clean sprite test pot mo mo-all help docs assets pep8
all: help
build: docs mo assets
python setup.py sdist ${FORMATS} ${TAIL}
assets:
npm --version
node --version
cd ${JS_DIR} && \
npm cache clear && \
npm install && \
cd ${CWD}
python manage.py webpack --extra=--display-error-details
mkdir -p ${ASSETS_DIR}
python manage.py collectstatic --noinput --clear -i node_modules -i *.jsx ${TAIL}
python manage.py assets build ${TAIL}
chmod 664 ${ASSETS_DIR}.webassets-cache/*
docs:
# Make sure that the submodule with docs theme is pulled and up-to-date.
git submodule update --init
# The following creates the HTML docs.
# NOTE: cd and make must be in the same line.
cd ${DOCS_DIR}; make SPHINXOPTS="-W -q" html ${TAIL}
docs-review: docs
python -mwebbrowser file://$(shell pwd)/${DOCS_DIR}/_build/html/index.html
sprite:
glue --sprite-namespace="" --namespace="" ${SPRITE_DIR} --css=${CSS_DIR} --img=${IMAGES_DIR}
clean:
rm -rf ${TEST_ENV_NAME}
test: clean assets
virtualenv ${TEST_ENV_NAME} && \
source ${TEST_ENV_NAME}/bin/activate && \
pip install -r requirements/tests.txt && \
python setup.py test
pot:
@${SRC_DIR}/tools/createpootlepot
get-translations:
ssh pootle.locamotion.org ". /var/www/sites/pootle/env/bin/activate; python /var/www/sites/pootle/src/manage.py sync_stores --verbosity=1 --project=pootle"
rsync -az --delete --exclude="LINGUAS" --exclude=".translation_index" --exclude=pootle-terminology.po pootle.locamotion.org:/var/www/sites/pootle/translations/pootle/ ${SRC_DIR}/locale
for po in $$(find ${SRC_DIR}/locale -name "*.po"); do msgcat $$po > $$po.2 && mv $$po.2 $$po; done
put-translations:
rsync -azv --progress --exclude="*~" --exclude="*.mo" --exclude="LC_MESSAGES" --exclude=unicode --exclude="LINGUAS" --exclude=".translation_index" --exclude=pootle-terminology.po ${SRC_DIR}/locale/ pootle.locamotion.org:/var/www/sites/pootle/translations/pootle/
ssh pootle.locamotion.org ". /var/www/sites/pootle/env/bin/activate; python /var/www/sites/pootle/src/manage.py update_stores --verbosity=1 --project=pootle"
linguas:
@${SRC_DIR}/tools/make-LINGUAS.sh 80 > ${SRC_DIR}/locale/LINGUAS
mo:
python setup.py build_mo ${TAIL}
mo-all:
python setup.py build_mo --all
pep8:
@./pootle/tools/pep8.sh travis
publish-pypi:
python setup.py sdist ${FORMATS} upload
help:
@echo "Help"
@echo "----"
@echo
@echo " assets - collect and rebuild the static assets"
@echo " build - create sdist with required prep"
@echo " docs - build Sphinx docs"
@echo " docs-review - launch webbrowser to review docs"
@echo " sprite - create CSS sprite"
@echo " clean - remove any temporal files"
@echo " test - run test suite"
@echo " pep8 - run pep8 checks"
@echo " pot - update the POT translations templates"
@echo " get-translations - retrieve Pootle translations from server (requires ssh config for pootletranslations)"
@echo " linguas - update the LINGUAS file with languages over 80% complete"
@echo " mo - build MO files for languages listed in 'pootle/locale/LINGUAS'"
@echo " mo-all - build MO files for all languages (only use for testing)"
@echo " publish-pypi - publish on PyPI"