make most scripts exit on error

tested only on cygwin - if it causes issues on linux, feel free to rollback


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162859 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2004-07-18 01:22:49 +00:00
parent 07cfd28f67
commit cf719faeda
5 changed files with 13 additions and 6 deletions

2
ci.sh
View File

@ -24,7 +24,7 @@ export PATH=$PATH:$MBOOT_HOME:$M2_HOME/bin:$JAVA_HOME/bin
CMD=$1 CMD=$1
[ "$1" = "" ] && echo && echo "You must specify a checkout or update!" && echo && exit [ "$1" = "" ] && echo && echo "You must specify a checkout or update!" && echo && exit 1
HOME_DIR=`pwd` HOME_DIR=`pwd`
DATE=`date` DATE=`date`

View File

@ -44,7 +44,7 @@ findAndSetMavenRepoLocal()
{ {
if [ -f $HOME/build.properties ] if [ -f $HOME/build.properties ]
then then
repoLocal=`cat $HOME/build.properties | grep "maven.repo.local" | sed 's/^.*= *//'` repoLocal=`cat $HOME/build.properties | egrep "^maven.repo.local" | sed 's/^.*= *//'`
else else
repoLocal=$HOME/.maven/repository repoLocal=$HOME/.maven/repository
fi fi
@ -504,7 +504,7 @@ fi
if [ ! -x "$JAVACMD" ] ; then if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." echo "Error: JAVA_HOME is not defined correctly."
echo " We cannot execute $JAVACMD" echo " We cannot execute $JAVACMD"
exit exit 1
fi fi
# For Cygwin, switch to Windows format before running java # For Cygwin, switch to Windows format before running java

View File

@ -64,8 +64,8 @@ export MBOOT_HOME=`dirname $0`
. ${MBOOT_HOME}/maven.functions . ${MBOOT_HOME}/maven.functions
[ ! -d $dir ] && echo "Specified directory doesn't exist!" && exit [ ! -d $dir ] && echo "Specified directory doesn't exist!" && exit 1
[ ! -f $dir/${POM} ] && echo "No ${POM} in specified directory!" && exit [ ! -f $dir/${POM} ] && echo "No ${POM} in specified directory!" && exit 1
buildMavenProject $dir $jar $install $pomInstall $leaveBootFiles buildMavenProject $dir $jar $install $pomInstall $leaveBootFiles

View File

@ -68,7 +68,7 @@ export MBOOT_HOME=`dirname $0`
. ${MBOOT_HOME}/maven.functions . ${MBOOT_HOME}/maven.functions
[ ! -f $model ] && echo "Specified model doesn't exist!" && exit [ ! -f $model ] && echo "Specified model doesn't exist!" && exit 1
[ ! -d $dir ] && mkdir -p $dir [ ! -d $dir ] && mkdir -p $dir

View File

@ -4,21 +4,28 @@ rm -rf target
# Generate the sources from the model # Generate the sources from the model
modello --model=maven.mdo --version=4.0.0 --mode=java --dir=target/generated-sources modello --model=maven.mdo --version=4.0.0 --mode=java --dir=target/generated-sources
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
# Generate the source for the xpp3 marshaller and unmarshaller # Generate the source for the xpp3 marshaller and unmarshaller
modello --model=maven.mdo --version=4.0.0 --mode=xpp3 --dir=target/generated-sources modello --model=maven.mdo --version=4.0.0 --mode=xpp3 --dir=target/generated-sources
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
# Generate the 3.0.0 source from the model # Generate the 3.0.0 source from the model
modello --model=maven.mdo --version=3.0.0 --mode=java --dir=target/generated-sources --package-with-version modello --model=maven.mdo --version=3.0.0 --mode=java --dir=target/generated-sources --package-with-version
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
# Generate the 3.0.0 source for the xpp3 marshaller and unmarshaller # Generate the 3.0.0 source for the xpp3 marshaller and unmarshaller
modello --model=maven.mdo --version=3.0.0 --mode=xpp3 --dir=target/generated-sources --package-with-version modello --model=maven.mdo --version=3.0.0 --mode=xpp3 --dir=target/generated-sources --package-with-version
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
# Generate XML Schema # Generate XML Schema
modello --model=maven.mdo --version=4.0.0 --mode=xsd --dir=. modello --model=maven.mdo --version=4.0.0 --mode=xsd --dir=.
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
# Generate XDoc # Generate XDoc
modello --model=maven.mdo --version=4.0.0 --mode=xdoc --dir=target/generated-xdocs modello --model=maven.mdo --version=4.0.0 --mode=xdoc --dir=target/generated-xdocs
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
# Build the sources # Build the sources
mboot --install mboot --install
ret=$?; if [ $ret != 0 ]; then exit $ret; fi