/
run_development_cycle.sh
executable file
·66 lines (49 loc) · 1.61 KB
/
run_development_cycle.sh
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
#!/bin/bash
# Copyright 2017 Vincent Jacques <vincent@vincent-jacques.net>
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
# Install dependencies
eval `opam config env`
opam install --yes bisect_ppx bisect-summary General yojson
clear
# Build
# https://github.com/aantron/bisect_ppx/blob/master/doc/advanced.md#Dune suggests
# modifying the dune file for release. Let's modify it for tests instead.
sed -i "s/^;\(.*bisect_ppx.*\)$/\1/" ocaml_autodoc/dune
dune build ocaml_autodoc/ocaml_autodoc.exe
sed -i "s/^\(.*bisect_ppx.*\)$/;\1/" ocaml_autodoc/dune
# Test
rm -f bisect????.out
coverage3 erase
rm -rf test/output build/test_doctrees
coverage3 run --branch --include "sphinxcontrib/*" $(which sphinx-build) test/input test/output -d build/test_doctrees
echo
echo "See test documentation in $(pwd)/test/output/index.html"
echo
bisect-summary bisect????.out
echo
coverage3 report
echo
bisect-ppx-report -I ocaml_autodoc -html ocaml_autodoc/_build/bisect bisect????.out
coverage3 html --directory build/coverage
echo "See coverage reports in $(pwd)/ocaml_autodoc/_build/bisect/index.html"
echo "and $(pwd)/build/coverage/index.html"
echo
rm -f bisect????.out
coverage3 erase
# Check
pycodestyle --max-line-length=120 sphinxcontrib *.py doc/conf.py
# Install and use to build doc
./setup.py --quiet install --user
opam pin --yes --no-action add --kind=path .
opam reinstall --yes sphinxcontrib-ocaml
rm -rf docs build/sphinx
./setup.py build_sphinx
cp -r build/sphinx/html docs
rm -f docs/.buildinfo
echo
echo "See documentation in $(pwd)/docs/index.html"
echo
echo
echo "Development cycle OK"