From 6c601ecf66aa3d7cd112aa4b7444056fd833a47c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 16 May 2023 00:36:10 +0200 Subject: [PATCH] Continued: - 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 | 7 +++++-- build-dist-cores.sh | 24 +++++++++++++++++------- make-javadoc.sh | 4 ++++ 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/.jprojects.sh b/.jprojects.sh index 673c5dc..a024aeb 100644 --- a/.jprojects.sh +++ b/.jprojects.sh @@ -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 diff --git a/build-dist-cores.sh b/build-dist-cores.sh index 2c702fc..defc3e9 100755 --- a/build-dist-cores.sh +++ b/build-dist-cores.sh @@ -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 diff --git a/make-javadoc.sh b/make-javadoc.sh index bf6efec..313f985 100755 --- a/make-javadoc.sh +++ b/make-javadoc.sh @@ -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 ..." -- 2.39.2