2 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
3 ##############################################################################
4 # Copyright (c) 2016 Red Hat, Inc. and others.
5 # Copyright (c) 2017 The Linux Foundation and others.
7 # All rights reserved. This program and the accompanying materials
8 # are made available under the terms of the Eclipse Public License v1.0
9 # which accompanies this distribution, and is available at
10 # http://www.eclipse.org/legal/epl-v10.html
11 ##############################################################################
13 CSIT_DIR="../csit/libraries"
14 ROBOT_DIR="$(pwd)/_static/integration/robot"
15 TMP_ROBOT_DIR="$(pwd)/_build/robot"
17 mkdir -p "$ROBOT_DIR" "$TMP_ROBOT_DIR"
19 # --- START BUILD ROBOT DOCS --- #
21 csit_dirs=($(find . -type d | sed 's#./##'))
22 csit_files=($(find . -type f -name "*.py" -o -name "*.robot" | sed 's#./##'))
25 mkdir -p ${csit_dirs[*]}
27 pushd "$TMP_ROBOT_DIR"
28 mkdir -p ${csit_dirs[*]}
31 if hash parallel 2>/dev/null; then
32 parallel --jobs 200% --halt now,fail=1 python -m robot.libdoc "{}" "$TMP_ROBOT_DIR/{}.html" ::: ${csit_files[*]}
34 for f in "${csit_files[@]}"; do
35 python -m robot.libdoc "$f" "$TMP_ROBOT_DIR/$f.html"
39 # --- END BUILD ROBOT DOCS --- #
41 # --- START BUILD ROBOT INDEX --- #
42 pushd "$TMP_ROBOT_DIR"
43 echo "<html><body><ul>" > "$ROBOT_DIR/index.html"
45 html_files=($(find . -type f -name "*.html" | sed 's#./##'))
46 for f in "${html_files[@]}"; do
47 sed 's/black/orange/; s/white/black/; s/^<body>/<body><img src="..\/..\/logo.png">/' "$f" > "$ROBOT_DIR/$f"
48 echo "<li><a href=\"$f\">$f</a></li>" >> "$ROBOT_DIR/index.html"
51 echo "</ul></body></html>" >> "$ROBOT_DIR/index.html"
53 # --- END BUILD ROBOT INDEX --- #