task_python_docs.sh 1.67 KB
Newer Older
1
#!/bin/bash
2 3 4 5 6 7 8
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
9
#
10
#   http://www.apache.org/licenses/LICENSE-2.0
11
#
12 13 14 15 16 17
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
18 19 20 21

set -e
set -u

22
# cleanup old states
23
rm -rf docs/_build
24
mkdir -p docs/_build/html
25 26
rm -rf docs/gen_modules
rm -rf docs/doxygen
27 28 29

# remove stale tutorials and always build from scratch.
rm -rf docs/tutorials
30
rm -rf docs/vta/tutorials
31

32 33
# cleanup stale log files
find . -type f -path "*.log" | xargs rm -f
34
find . -type f -path "*.pyc" | xargs rm -f
35
make cython3
36 37 38 39 40

cd docs
PYTHONPATH=`pwd`/../python make html
cd ..

41 42
# C++ doc
make doc
43
rm -f docs/doxygen/html/*.map docs/doxygen/html/*.md5
44 45

# JS doc
46
jsdoc -c web/.jsdoc_conf.json web/tvm_runtime.js web/README.md
47

48
# Java doc
49
make javadoc
50 51 52 53 54 55 56

# Prepare the doc dir
rm -rf _docs
mv docs/_build/html _docs
rm -f _docs/.buildinfo
mv docs/doxygen/html _docs/doxygen
mv out _docs/jsdoc
57
mv jvm/core/target/site/apidocs _docs/javadoc
58

59 60
echo "Start creating the docs tarball.."
# make the tarball
61
tar -C _docs -czf docs.tgz .
62 63
echo "Finish creating the docs tarball"
du -h docs.tgz