da631c788c
It is hard to figure out, why no documentation is built, if asciidoc is not installed on the build system. Thus, abort the build and advise to either install asciidoc or add the --without-documentation parameter. Change-Id: I12c5c71d4f36333eabf01515344111ee9436a07c
51 lines
930 B
Bash
Executable File
51 lines
930 B
Bash
Executable File
#!/bin/sh
|
|
|
|
include_docs=-Dgerrit.include-documentation=1
|
|
|
|
while [ $# -gt 0 ]
|
|
do
|
|
case "$1" in
|
|
--no-documentation|--without-documentation)
|
|
include_docs=
|
|
shift
|
|
;;
|
|
*)
|
|
echo >&2 "usage: $0 [--without-documentation]"
|
|
exit 1
|
|
esac
|
|
done
|
|
|
|
git update-index -q --refresh
|
|
|
|
if test -n "$(git diff-index --name-only HEAD --)" \
|
|
|| test -n "$(git ls-files --others --exclude-standard)"
|
|
then
|
|
echo >&2 "error: working directory is dirty, refusing to build"
|
|
exit 1
|
|
fi
|
|
|
|
|
|
if test -n "$include_docs"
|
|
then
|
|
BINARY=asciidoc
|
|
if ! command -v $BINARY >/dev/null 2>&1
|
|
then
|
|
echo >&2 "error: $BINARY executable was not found. Either install $BINARY or use the --without-documentation option"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
./tools/version.sh --release &&
|
|
mvn clean install $include_docs -P all
|
|
rc=$?
|
|
./tools/version.sh --reset
|
|
|
|
if test 0 = $rc
|
|
then
|
|
echo
|
|
echo Built Gerrit Code Review `git describe`:
|
|
ls gerrit-war/target/gerrit-*.war
|
|
echo
|
|
fi
|
|
exit $rc
|