From 4dadc7a005ca99aa5a14ac650e9aa187cea10619 Mon Sep 17 00:00:00 2001 From: Tibor Frank Date: Wed, 23 Nov 2016 09:42:29 +0100 Subject: CSIT-474: CSIT doc auto-generation - See resources/tools/doc_gen/README.rst for details Change-Id: Ie5704c93a41e456d65fcd6df2d9d8c96987deebb Signed-off-by: Tibor Frank --- resources/tools/doc_gen/run_doc.sh | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 resources/tools/doc_gen/run_doc.sh (limited to 'resources/tools/doc_gen/run_doc.sh') diff --git a/resources/tools/doc_gen/run_doc.sh b/resources/tools/doc_gen/run_doc.sh new file mode 100755 index 0000000000..bbb9940468 --- /dev/null +++ b/resources/tools/doc_gen/run_doc.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +WORKING_DIR='tmp' +BUILD_DIR='_build' + +# Clean-up when finished: +trap 'rm -rf ${WORKING_DIR}; exit' EXIT +trap 'rm -rf ${WORKING_DIR}; exit' ERR + +# Remove the old build: +rm -rf ${BUILD_DIR} || true +rm -rf ${WORKING_DIR} || true + +# Create working directories +mkdir ${BUILD_DIR} +mkdir --parents ${WORKING_DIR}/resources/libraries/python/ +mkdir --parents ${WORKING_DIR}/resources/libraries/robot/ +mkdir --parents ${WORKING_DIR}/tests/ + +# Copy the Sphinx source files: +cp -r src/* ${WORKING_DIR}/ + +# Copy the source files to be processed: +rsync -a --include '*/' --include '*.py' --exclude '*' ../../../resources/libraries/python/ ${WORKING_DIR}/resources/libraries/python/ +cp ../../../resources/__init__.py ${WORKING_DIR}/resources/ +cp ../../../resources/libraries/__init__.py ${WORKING_DIR}/resources/libraries/ +rsync -a --include '*/' --include '*.robot' --exclude '*' ../../../resources/libraries/robot/ ${WORKING_DIR}/resources/libraries/robot/ +rsync -a --include '*/' --include '*.robot' --exclude '*' ../../../tests/ ${WORKING_DIR}/tests/ + +# Create virtual environment: +virtualenv ${WORKING_DIR}/env +. ${WORKING_DIR}/env/bin/activate + +# Install CSIT requirements: +pip install -r ../../../requirements.txt +# Install Sphinx: +pip install -r ${WORKING_DIR}/requirements.txt + +export PYTHONPATH=`pwd` + +# Generate rst files: +./gen_rst.py + +# Generate the documentation: +sphinx-build -vvv -b html ${WORKING_DIR}/ ${BUILD_DIR}/ \ No newline at end of file -- cgit 1.2.3-korg