#!/bin/sh
#
# Wrapper around `swift build' that uses pkg-config in config.sh
# to determine compiler and linker flags
#
. ./config.sh
[ -e Sources/${Module}.swift ] || ./generate-wrapper.sh
if [ -z "$@" ]; then
    JAZZY_ARGS="--theme fullwidth --author Ren&eacute;&nbsp;Hexel --author_url https://www.ict.griffith.edu.au/~rhexel/ --github_url https://github.com/rhx/Swift$Pkg --github-file-prefix https://github.com/rhx/Swift$Pkg/tree/generated --root-url http://rhx.github.io/Swift$Pkg/ --output docs"
fi
[ -e "$BUILD_DIR/build.db" ] || ./build.sh
rm -rf .docs.old
mv docs .docs.old 2>/dev/null
sourcekitten doc --spm-module $Mod -- --build-path "$BUILD_DIR"		\
	$CCFLAGS $LINKFLAGS > "$BUILD_DIR/$Mod-doc.json"
jazzy --sourcekitten-sourcefile "$BUILD_DIR/$Mod-doc.json" --clean	\
      --module-version $JAZZY_VER --module $Mod $JAZZY_ARGS "$@"

#!/bin/sh
#
# Wrapper around `swift build' that uses pkg-config in config.sh
# to determine compiler and linker flags
#
. ./config.sh
[ -e Sources/${Module}.swift ] || ./generate-wrapper.sh
if [ -z "$@" ]; then
    JAZZY_ARGS="--theme fullwidth --author Ren&eacute;&nbsp;Hexel --author_url https://www.ict.griffith.edu.au/~rhexel/ --github_url https://github.com/rhx/Swift$Pkg --github-file-prefix https://github.com/rhx/Swift$Pkg/tree/generated --root-url http://rhx.github.io/Swift$Pkg/ --output docs"
fi
[ -e "$BUILD_DIR/build.db" ] || ./build.sh
rm -rf .docs.old
mv docs .docs.old 2>/dev/null
[ -e .build ] || ln -s "$BUILD_DIR" .build
sourcekitten doc --spm-module $Mod -- --build-path "$BUILD_DIR"		\
	$CCFLAGS $LINKFLAGS > "$BUILD_DIR/$Mod-doc.json"
jazzy --sourcekitten-sourcefile "$BUILD_DIR/$Mod-doc.json" --clean	\
      --module-version $JAZZY_VER --module $Mod $JAZZY_ARGS "$@"
rm -f .build 2>/dev/null

Create symlink to work around lack of sourcekitten build path support.
Create symlink to work around lack of sourcekitten build path support.
