-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
52 lines (39 loc) · 1.59 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
file_finder = find . -type f \( $(1) \) -not \( -path '*/venv/*' -o -path '*/build/*' -o -path '*/cmake-build-debug/*' -o -path '*/workspace/*' \)
export_runner = python3 tools/export_files.py $(1) -o export/$(2) && cd export && zip -r $(2).zip $(2)
SLIDE_FILES = $(call file_finder,-name slide-deck.md)
SLIDE_FILES_LIGHT = $(call file_finder,-name slide-deck-light.md)
.PHONY: test
test:
cd tools && python3 -m unittest discover
coverage:
cd tools && coverage run --source=. -m unittest discover
cd tools && coverage report -m
coverage_reports: coverage
cd tools && coverage xml
sed -i -e 's, filename=", filename="tools/,g' tools/coverage.xml
cd tools && coverage html
.PHONY: slides
slides: light_theme_slides
cd slides && mkdir -p build && cp -r lecture/images build/
cd slides && docker compose run generate --input-dir ./lecture
cd slides && docker compose run generate --input-dir ./lecture --pdf
cd slides && docker compose run generate --input-dir ./homework
cd slides && docker compose run generate --input-dir ./homework --pdf
serve: light_theme_slides
cd slides && docker compose up
.PHONY: docs
docs:
cd docs && docker compose run html
cd docs && docker compose run pdf
clean_export:
rm -rf export
light_theme_slides:
$(SLIDE_FILES) | xargs -I '{}' sh -c 'v={}; cp $$v $${v%.md}-light.md'
$(SLIDE_FILES_LIGHT) | xargs sed -i '/class. invert/d'
$(SLIDE_FILES_LIGHT) | xargs sed -i '/- invert/d'
clean_workspace:
rm -rf workspace
package: clean_export
$(call export_runner,source/example,example)
solution_package: clean_export
$(call export_runner,source/example -k,example_solution)