continue
fi
- echo "$0: Executing '${project}' ..."
P=${project%/*}
-
echo "$0: P='${P}'"
cd "${JPROJECTS_HOME}/${P}" || exit 255
- if [ ! -e "build.xml" ]
+ if [ ! -f "build.xml" ]
then
echo "$0: No build.xml found, skipping project '${P}'."
continue
if [ "$1" = "c" ]
then
# Cleanup
+ echo "$0: Cleaning up '${project}' ..."
${ANT_BIN} clean
fi
# Build JAR
+ echo "$0: Building JAR for '${project}' ..."
"${ANT_BIN}" jar
# Save status
STATUS="$?"
# Has it failed?
+ echo "$0: STATUS='${STATUS}'"
if [ "${STATUS}" != "0" ]
then
- # This has failed, so try "dist"
- "${ANT_BIN}" dist
+ echo "$0: Failed to build '${project}'."
+ exit 1
+ fi
+
+ # Is a "test" directory there?
+ if [ -d "test" ]
+ then
+ echo "$0: Running unit tests ..."
+ "${ANT_BIN}" test
+
+ # Save status
STATUS="$?"
- # Still failing? Oh, to bad
+ # Has it failed?
if [ "${STATUS}" != "0" ]
then
- echo "$0: Failed to build '${project}'."
+ echo "$0: Failed to test '${project}'."
exit 1
fi
fi