taskflow/tools/generate_states.sh
Joshua Harlow e54cb21d55 Use the state_graph.py for all states diagrams
Switch to using the `state_graph.py` and dot output
as the source of all of the state diagrams (this
makes it easy for anyone to recreate them by just
running the script in the tools directory).

Also update the state diagram creator to have engine
states as well as retry states and replaces all
existing state diagrams with the updated prettified
versions.

Also adjusts some nits around wording and grammar that
were encountered during this updating process.

Change-Id: Ia783aed6c4136763e1e34cbd0b3e57ffb1109abe
2014-07-06 12:21:34 -07:00

33 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -u
xsltproc=`which xsltproc`
if [ -z "$xsltproc" ]; then
echo "Please install xsltproc before continuing."
exit 1
fi
set -e
if [ ! -d "$PWD/.diagram-tools" ]; then
git clone "https://github.com/vidarh/diagram-tools.git" "$PWD/.diagram-tools"
fi
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
img_dir="$script_dir/../doc/source/img"
echo "---- Updating task state diagram ----"
python $script_dir/state_graph.py -t -f /tmp/states.svg
$xsltproc $PWD/.diagram-tools/notugly.xsl /tmp/states.svg > $img_dir/task_states.svg
echo "---- Updating flow state diagram ----"
python $script_dir/state_graph.py -f /tmp/states.svg
$xsltproc $PWD/.diagram-tools/notugly.xsl /tmp/states.svg > $img_dir/flow_states.svg
echo "---- Updating engine state diagram ----"
python $script_dir/state_graph.py -e -f /tmp/states.svg
$xsltproc $PWD/.diagram-tools/notugly.xsl /tmp/states.svg > $img_dir/engine_states.svg
echo "---- Updating retry state diagram ----"
python $script_dir/state_graph.py -r -f /tmp/states.svg
$xsltproc $PWD/.diagram-tools/notugly.xsl /tmp/states.svg > $img_dir/retry_states.svg