for project in ${ALL_PROJECTS}; do
if [ ! -d "${project}" ]
then
- echo "$0: Project '${project}' not created."
+ echo "$0: WARNING: Project '${project}' not created."
elif [ ! -f "${project}/.git/config" ]
then
- echo "$0: Project '${project}' is no GIT project."
+ echo "$0: ERROR: Project '${project}' is no GIT project."
exit 1
+ elif [ "${project}" != "jprojects-scripts" -a ! -d "${JPROJECTS_HOME}/${project}/src/" ]
+ then
+ echo "$0: WARNING: Project '${project}' has no 'src' directory."
fi
# Add it as available
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
then
echo "$0: Not uploading company project='${project}'"
continue
+ elif [ -f "src/.gitkeep" ]
+ then
+ echo "$0: project='${project}' has a .gitkeep file in 'src', won't scan."
+ continue
fi
echo "$0: Generating 'javadoc/${project}' on remote server ..."