genDocs.sh 979 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
#!/bin/sh

###
# Fix jazzy/sourcekitten error about libswiftCore.dylib: https://github.com/realm/jazzy/issues/159
###

scriptDir="`dirname $0`"
scriptName="`basename $0`"
absScriptDir="`cd $scriptDir; pwd`"
docsdir=${absScriptDir}/docs

fatal() {
	echo "[fatal] $1" 1>&2
	exit 1
}

absPath() {
	case "$1" in
		/*)
			printf "%s\n" "$1"
			;;
		*)
			printf "%s\n" "$PWD/$1"
			;;
	esac;
}

main() {
	if [ ! -d ${docsdir} ]; then
		mkdir -p ${docsdir}
	fi

	rm -r ${docsdir}/*
	java -jar ${absScriptDir}/3rdParty/plantuml.8020.jar -o ${docsdir} -graphvizdot "/opt/local/bin/dot" ${absScriptDir}/Documentation/class.pu ${absScriptDir}/Documentation/sequence.pu || fatal "Failed to create diagrams"
	jazzy -a "Mark Spanbroek and Stefan van den Oord" -u https://source.ind.ie/project/pulse-swift -m "Pulse-Swift" --min-acl public || fatal "Documentation generation failed"
}

which -s jazzy || fatal "Documentation generator 'jazzy' not found. Can be installed as ruby gem."
main $*