]> git.mxchange.org Git - jprojects-scripts.git/blobdiff - build-dist-cores.sh
Continued:
[jprojects-scripts.git] / build-dist-cores.sh
index 2c702fcfb1f09f8d2dc1b8a69a417ecfad4ecb1a..defc3e95330816076159f0695d0c17d58c425e84 100755 (executable)
@@ -19,13 +19,11 @@ for project in ${LIST}; do
                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
@@ -36,26 +34,38 @@ for project in ${LIST}; do
                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