This repository has been archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
74 lines (63 loc) · 2.47 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
.PHONY: help clean clean-pyc release dist
help:
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "release - package and upload a release"
@echo "dist - package"
clean: clean-build clean-pyc
clean-build:
rm -fr build/
rm -fr dist/
rm -fr dist-packages-cache/
rm -fr dist-packages-temp/
rm -fr *.egg-info
rm -fr .eggs
rm -fr .cache
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
update-perseus:
# update the constants.js to store the mathjax config file name.
# Ben: This seems like it doesn't detect the file name?
# This doesn't work, but until we have to update perseus, this should
# is not important
> kolibri_exercise_perseus_plugin/assets/src/constants.js
config_file_name="$(basename kolibri_exercise_perseus_plugin/static/mathjax/2.1/config/*)"
file_content="const ConfigFileName = '${config_file_name}'; module.exports = { ConfigFileName };"
echo "${file_content}" >> kolibri_exercise_perseus_plugin/assets/src/constants.js
yarn run extract-messages
dev:
yarn run dev
assets:
# move mathjax to static folder for our hacky loading
rm -f -r kolibri_exercise_perseus_plugin/static
mkdir kolibri_exercise_perseus_plugin/static
cp -r submodules/perseus/lib/mathjax kolibri_exercise_perseus_plugin/static/
mkdir kolibri_exercise_perseus_plugin/static/images
cp submodules/perseus/images/spinner.gif kolibri_exercise_perseus_plugin/static/images
cp -r submodules/perseus/lib/mathquill/fonts kolibri_exercise_perseus_plugin/static/
yarn run clean && yarn run build && yarn run makemessages
check-build:
[ -e kolibri_exercise_perseus_plugin/static/images/spinner.gif ] || ( echo "Please run: make assets" && exit 1 )
dist: clean assets check-build
python setup.py bdist_wheel --universal
release:
@ls -l dist/ || (echo "Nothing built, no dist/ so nothing to release" && exit 1)
@echo "Documentation: See README.rst"
@echo ""
@echo ""
@echo "Quick check list:"
@echo ""
@echo "1. Committed CrowdIn translations to repo?"
@echo "2. Your git repo has no local changes?"
@echo "3. Ensure that you have built the frontend files using Kolibri"
@echo "4. Version info bumped in __init__.py"
@echo "5. Ran 'make assets' to build everything"
@echo "6. Running 'make dist' to generate a wheel file"
@echo ""
@echo "Do you want to upload everything in dist/*?"
@echo ""
@echo "CTRL+C to exit. ENTER to continue."
@read __
twine upload -s dist/*