X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=docs%2Fbuild-integration-robot-libdoc.sh;h=038b4c610649c15f68ff663ed3d8ac89a1cd6b0a;hb=b0aeabe0ee456229949836e8367c9bebd00ac464;hp=1e2c9764dea5c6eb97440fa0e634772fc781def7;hpb=199205046fd007c6888f34ec6968a0f8ba744535;p=docs.git diff --git a/docs/build-integration-robot-libdoc.sh b/docs/build-integration-robot-libdoc.sh index 1e2c9764d..038b4c610 100755 --- a/docs/build-integration-robot-libdoc.sh +++ b/docs/build-integration-robot-libdoc.sh @@ -1,10 +1,53 @@ #!/bin/bash +# @License EPL-1.0 +############################################################################## +# Copyright (c) 2016 Red Hat, Inc. and others. +# Copyright (c) 2017 The Linux Foundation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +############################################################################## -ROBOT_DIR=`pwd`/_static/integration/robot +CSIT_DIR="submodules/integration/test/csit/libraries" +ROBOT_DIR="$(pwd)/_static/integration/robot" +TMP_ROBOT_DIR="$(pwd)/_build/robot" -mkdir -p $ROBOT_DIR -cd submodules/integration/test/csit/libraries -for f in *.robot; do python -m robot.libdoc $f $ROBOT_DIR/$f.html; done -for f in *.py; do python -m robot.libdoc $f $ROBOT_DIR/$f.html; done -cd $ROBOT_DIR/ -for f in *.html; do sed -i 's/black/orange/; s/white/black/; s/^//' $f; done +mkdir -p "$ROBOT_DIR" "$TMP_ROBOT_DIR" + +# --- START BUILD ROBOT DOCS --- # +pushd "$CSIT_DIR" +csit_dirs=($(find . -type d | sed 's#./##')) +csit_files=($(find . -type f -name "*.py" -o -name "*.robot" | sed 's#./##')) + +pushd "$ROBOT_DIR" +mkdir -p ${csit_dirs[*]} +popd +pushd "$TMP_ROBOT_DIR" +mkdir -p ${csit_dirs[*]} +popd + +if hash parallel 2>/dev/null; then + parallel --jobs 200% --halt now,fail=1 python2 -m robot.libdoc "{}" "$TMP_ROBOT_DIR/{}.html" ::: ${csit_files[*]} +else + for f in "${csit_files[@]}"; do + python -m robot.libdoc "$f" "$TMP_ROBOT_DIR/$f.html" + done +fi +popd +# --- END BUILD ROBOT DOCS --- # + +# --- START BUILD ROBOT INDEX --- # +pushd "$TMP_ROBOT_DIR" +echo "" >> "$ROBOT_DIR/index.html" +popd +# --- END BUILD ROBOT INDEX --- #