]> git.mxchange.org Git - jprojects-scripts.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 19 Apr 2020 18:26:37 +0000 (20:26 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 19 Apr 2020 18:26:37 +0000 (20:26 +0200)
- addressbook is far unmaintained and needs more love
- added build-dist-<cores|libs>.sh
- added commit-jlibs.sh

Signed-off-by: Roland Häder <roland@mxchange.org>
.jprojects.sh
build-dist-cores.sh [new file with mode: 0755]
build-dist-libs.sh [new file with mode: 0755]
commit-jlibs.sh [new file with mode: 0755]
commit-jprojects.sh

index 9eb43e8d6efc17c32c686deeb344b62c3f1640f3..802e0ef57313f64d0748029a76a979902952fdee 100644 (file)
@@ -30,7 +30,10 @@ BASE_APPLICATION_NAMES="addressbook jfinancials jjobs jjobboards pizzaservice"
 APPLICATIONS="pizzaservice-core pizzaservice-lib pizzaservice-mailer-ejb pizzaservice-mailer-lib pizzaservice-ejb pizzaservice-swing \
        jjobs-core jjobs-lib jjobs-mailer-ejb jjobs-mailer-lib jjobs-ejb jjobs-war jjobs \
        jfinancials-core jfinancials-lib jfinancials-mailer-ejb jfinancials-mailer-lib jfinancials-ejb jfinancials-war jfinancials
-       addressbook-core addressbook-lib addressbook-mailer-ejb addressbook-mailer-lib addressbook-ejb addressbook-war addressbook addressbook-uml"
+       addressbook-core addressbook-lib addressbook-mailer-ejb addressbook-mailer-lib addressbook-uml"
+
+# Unmaintained, but maybe not broken
+UNMAINTAINED="addressbook-ejb addressbook-war addressbook "
 
 # Company-specific projects
 COMPANY_PROJECTS="jjobboards-core jjobboards-lib jjobboards-mailer-ejb jjobboards-mailer-lib jjobboards-ejb jjobboards-war jjobboards"
@@ -39,7 +42,7 @@ COMPANY_PROJECTS="jjobboards-core jjobboards-lib jjobboards-mailer-ejb jjobboard
 BROKEN="addressbook-swing jfinancials-swing jjobboards-swing pizzaservice-war pizzaservice"
 
 # Compile list
-ALL_PROJECTS="${THIS} ${LIBRARIES} ${APPLICATIONS} ${COMPANY_PROJECTS} ${BROKEN}"
+ALL_PROJECTS="${THIS} ${LIBRARIES} ${APPLICATIONS} ${COMPANY_PROJECTS} ${UNMAINTAINED} ${BROKEN}"
 
 # Own home directory
 declare -r JPROJECTS_HOME="${PWD}"
diff --git a/build-dist-cores.sh b/build-dist-cores.sh
new file mode 100755 (executable)
index 0000000..2c702fc
--- /dev/null
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+. ./.jprojects.sh || exit 255
+
+for project in ${LIST}; do
+       IS_CORE="${project: -5}"
+
+       if [ "${project}" = "jprojects-scripts" ]
+       then
+               echo "$0: Skipping jprojects-scripts ..."
+               continue
+       elif [ "${IS_CORE}" != "-core" ]
+       then
+               echo "$0: Project '${project}' is no 'core', skipped."
+               continue
+       elif [ ! -d "${JPROJECTS_HOME}/${project}" ]
+       then
+               echo "$0: Project '${project}' does not exist."
+               continue
+       fi
+
+       echo "$0: Executing '${project}' ..."
+       P=${project%/*}
+
+       echo "$0: P='${P}'"
+       cd "${JPROJECTS_HOME}/${P}" || exit 255
+
+       if [ ! -e "build.xml" ]
+       then
+               echo "$0: No build.xml found, skipping project '${P}'."
+               continue
+       fi
+
+       if [ -x "${ANT_BIN}" -a "$1" != "d" ]
+       then
+               if [ "$1" = "c" ]
+               then
+                       # Cleanup
+                       ${ANT_BIN} clean
+               fi
+
+               # Build JAR
+               "${ANT_BIN}" jar
+
+               # Save status
+               STATUS="$?"
+
+               # Has it failed?
+               if [ "${STATUS}" != "0" ]
+               then
+                       # This has failed, so try "dist"
+                       "${ANT_BIN}" dist
+                       STATUS="$?"
+
+                       # Still failing? Oh, to bad
+                       if [ "${STATUS}" != "0" ]
+                       then
+                               echo "$0: Failed to build '${project}'."
+                               exit 1
+                       fi
+               fi
+       fi
+
+       if [ ! -f "./dist.sh" ]
+       then
+               echo "$0: Project '${project}' has no dist.sh"
+       elif [ ! -e "./dist.sh" ]
+       then
+               echo "$0: Error: Project '${project}' has non-executable dist.sh!"
+               exit 1
+       else
+               if [ "$1" = "r" ]
+               then
+                       ./dist.sh r
+               else
+                       ./dist.sh
+               fi
+       fi
+done
+
+echo "$0: All done."
+exit 0
diff --git a/build-dist-libs.sh b/build-dist-libs.sh
new file mode 100755 (executable)
index 0000000..0260908
--- /dev/null
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+. ./.jprojects.sh || exit 255
+
+for project in ${LIST}; do
+       IS_LIB="${project: -4}"
+
+       if [ "${project}" = "jprojects-scripts" ]
+       then
+               echo "$0: Skipping jprojects-scripts ..."
+               continue
+       elif [ "${IS_LIB}" != "-lib" ]
+       then
+               echo "$0: Project '${project}' is no remote-interface project - skipped."
+               continue
+       elif [ ! -d "${JPROJECTS_HOME}/${project}" ]
+       then
+               echo "$0: Project '${project}' does not exist."
+               continue
+       fi
+
+       echo "$0: Executing '${project}' ..."
+       P=${project%/*}
+
+       echo "$0: P='${P}'"
+       cd "${JPROJECTS_HOME}/${P}" || exit 255
+
+       if [ ! -e "build.xml" ]
+       then
+               echo "$0: No build.xml found, skipping project '${P}'."
+               continue
+       fi
+
+       if [ -x "${ANT_BIN}" -a "$1" != "d" ]
+       then
+               if [ "$1" = "c" ]
+               then
+                       # Cleanup
+                       ${ANT_BIN} clean
+               fi
+
+               # Build JAR
+               "${ANT_BIN}" jar
+
+               # Save status
+               STATUS="$?"
+
+               # Has it failed?
+               if [ "${STATUS}" != "0" ]
+               then
+                       # This has failed, so try "dist"
+                       "${ANT_BIN}" dist
+                       STATUS="$?"
+
+                       # Still failing? Oh, to bad
+                       if [ "${STATUS}" != "0" ]
+                       then
+                               echo "$0: Failed to build '${project}'."
+                               exit 1
+                       fi
+               fi
+       fi
+
+       if [ ! -f "./dist.sh" ]
+       then
+               echo "$0: Project '${project}' has no dist.sh"
+       elif [ ! -e "./dist.sh" ]
+       then
+               echo "$0: Error: Project '${project}' has non-executable dist.sh!"
+               exit 1
+       else
+               if [ "$1" = "r" ]
+               then
+                       ./dist.sh r
+               else
+                       ./dist.sh
+               fi
+       fi
+done
+
+echo "$0: All done."
+exit 0
diff --git a/commit-jlibs.sh b/commit-jlibs.sh
new file mode 100755 (executable)
index 0000000..e44e140
--- /dev/null
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+. ./.jprojects.sh || exit 255
+
+for project in ${LIST}; do
+       IS_LIB="${project: -4}"
+
+       if [ "${project}" = "jprojects-scripts" ]
+       then
+               echo "$0: Skipping jprojects-scripts ..."
+               continue
+       elif [ "${IS_LIB}" != "-lib" ]
+       then
+               echo "$0: Project '${project}' is no remote-interface project, skipped."
+               continue
+       elif [ ! -d "${JPROJECTS_HOME}/${project}" ]
+       then
+               echo "$0: Project '${project}' does not exist."
+               continue
+       fi
+
+       cd "${JPROJECTS_HOME}/${project}" || exit 255
+       CHECK_CHANGES=$(git commit -a --dry-run | grep "Changes to be committed:")
+
+       if [ -n "${CHECK_CHANGES}" ]
+       then
+               echo "$0: Committing '${project}' ..."
+               if [ "$1" = "updated jar(s)" ]
+               then
+                       # Special commit ... (known-binaries)
+                       git commit --signoff -S lib/*.jar -m "$1"
+               elif [ "$1" = "updated dist.sh" ]
+               then
+                       # Special commit ... (known shell script)
+                       git commit --signoff -S "dist.sh" -m "$1"
+               elif [ -n "$1" -a -n "$2" ]
+               then
+                       # Limited ommit with given message
+                       git commit $2 --signoff -S -m "$1" || exit 255
+               elif [ -d "$1" -o -f "$1" ]
+               then
+                       # Limited commit with no message
+                       git commit $1 --signoff -S || exit 255
+               elif [ -n "$1" ]
+               then
+                       # Regular commit with given message
+                       git commit -a --signoff -S -m "$1" || exit 255
+               else
+                       # Regular commit, will open $EDITOR for commit message
+                       git commit -a --signoff -S || exit 255
+               fi
+       else
+               echo "$0: Nothing to commit for project '${project}'."
+       fi
+done
+
+echo "$0: All done."
+exit 0
index 61ac979b0a8bab1170012342b7da088854332ddb..88ec307def8d200c8b96462565b891da7635d86d 100755 (executable)
@@ -31,6 +31,10 @@ for project in ${LIST}; do
                then
                        # Regular commit with given message
                        git commit $2 --signoff -S -m "$1" || exit 255
+               elif [ -d "$1" -o -f "$1" ]
+               then
+                       # Limited commit with no message
+                       git commit $1 --signoff -S || exit 255
                elif [ -n "$1" ]
                then
                        # Regular commit with given message