From 729eaed3627bf7c9f2ba6db1664e6367c8d57b3e Mon Sep 17 00:00:00 2001 From: Chris Rankin Date: Fri, 14 Jul 2017 14:53:09 +0100 Subject: [PATCH] Update DemoBench packager scripts to fail when packaging fails. (#1023) --- tools/demobench/package-demobench-dmg.sh | 13 +++++++++---- tools/demobench/package-demobench-exe.bat | 10 ++++++++-- tools/demobench/package-demobench-rpm.sh | 12 ++++++++---- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/tools/demobench/package-demobench-dmg.sh b/tools/demobench/package-demobench-dmg.sh index c72c6d3abe..ba0cddaa93 100755 --- a/tools/demobench/package-demobench-dmg.sh +++ b/tools/demobench/package-demobench-dmg.sh @@ -7,7 +7,12 @@ if [ -z "$JAVA_HOME" -o ! -x $JAVA_HOME/bin/java ]; then exit 1 fi -$DIRNAME/../../gradlew -PpackageType=dmg javapackage $* -echo -echo "Wrote installer to '$(find build/javapackage/bundles -type f)'" -echo +if ($DIRNAME/../../gradlew -PpackageType=dmg javapackage $*); then + echo + echo "Wrote installer to '$(find build/javapackage/bundles -type f)'" + echo +else + echo "Failed to create installer." + exit 1 +fi + diff --git a/tools/demobench/package-demobench-exe.bat b/tools/demobench/package-demobench-exe.bat index bb6c21191d..e33d048e5d 100644 --- a/tools/demobench/package-demobench-exe.bat +++ b/tools/demobench/package-demobench-exe.bat @@ -9,12 +9,18 @@ set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. call %DIRNAME%\..\..\gradlew -PpackageType=exe javapackage +if "%ERRORLEVEL%" neq "0" goto Fail @echo -@echo "Wrote installer to %DIRNAME%\build\javapackage\bundles\" +@echo Wrote installer to %DIRNAME%\build\javapackage\bundles\ @echo goto end :NoJavaHome -@echo "Please set JAVA_HOME correctly" +@echo Please set JAVA_HOME correctly. +exit /b 1 + +:Fail +@echo Failed to write installer. +exit /b 1 :end diff --git a/tools/demobench/package-demobench-rpm.sh b/tools/demobench/package-demobench-rpm.sh index 3d14661206..5bcc9c2167 100755 --- a/tools/demobench/package-demobench-rpm.sh +++ b/tools/demobench/package-demobench-rpm.sh @@ -7,7 +7,11 @@ if [ -z "$JAVA_HOME" -o ! -x $JAVA_HOME/bin/java ]; then exit 1 fi -$DIRNAME/../../gradlew -PpackageType=rpm javapackage $* -echo -echo "Wrote installer to '$(find $DIRNAME/build/javapackage/bundles -type f)'" -echo +if ($DIRNAME/../../gradlew -PpackageType=rpm javapackage $*); then + echo + echo "Wrote installer to '$(find $DIRNAME/build/javapackage/bundles -type f)'" + echo +else + echo "Failed to create installer." + exit 1 +fi