]> git.mxchange.org Git - jprojects-scripts.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Mon, 15 May 2023 22:36:10 +0000 (00:36 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 15 May 2023 22:43:38 +0000 (00:43 +0200)
- run unit-tests if proper directory 'test' is found
- don't generate javadoc if there is a .gitkeep file present in 'src' directory
- also check for 'src' directory, if absent a WARNING is printed

.jprojects.sh
build-dist-cores.sh
make-javadoc.sh

index 673c5dc61f4b4812c7ec132bb925f1749ad1200d..a024aeb831442380ef13710c32999c5c79fdb24a 100644 (file)
@@ -73,11 +73,14 @@ LIST=""
 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
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
index bf6efec8ccb02543ee0866e7bac382dd3b920da3..313f98558999d9787e7f94523ad7d5db59f14626 100755 (executable)
@@ -51,6 +51,10 @@ for project in ${LIST}; do
        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 ..."