Improvements
authorRoland Häder <roland@mxchange.org>
Mon, 18 Apr 2016 14:00:39 +0000 (16:00 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 18 Apr 2016 18:15:04 +0000 (20:15 +0200)
.gitattributes [new file with mode: 0644]
.jprojects.sh
build-dist-all.sh
cp-dist.sh
dist.sh
pull-stick.sh
push-stick.sh

diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..dfe0770
--- /dev/null
@@ -0,0 +1,2 @@
+# Auto detect text files and perform LF normalization
+* text=auto
index c2178e1..ae46e92 100644 (file)
@@ -30,12 +30,14 @@ LIST="${LIST} addressbook-swing"
 # Own home directory
 declare -r JPROJECTS_HOME="${PWD}"
 
+# ant binary
+ANT_BIN=`which ant`
+
 # Test on .git availability"
 for project in ${LIST}; do
        if [ ! -d "${project}" ]
        then
                echo "$0: Project '${project}' not created."
-               exit 1
        elif [ ! -f "${project}/.git/config" ]
        then
                echo "$0: Project '${project}' is no GIT project."
index 1738107..5ac2a3e 100755 (executable)
@@ -2,9 +2,15 @@
 
 . ./.jprojects.sh || exit 255
 
-for DIST in ${LIST}; do
-       echo "$0: Executing '${DIST}' ..."
-       P=${DIST%/*}
+for project in ${LIST}; do
+       if [ ! -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
@@ -15,10 +21,10 @@ for DIST in ${LIST}; do
                continue
        fi
 
-       if [ "$1" != "d" ]
+       if [ -x "${ANT_BIN}" -a "$1" != "d" ]
        then
                # Cleanup project and build JAR
-               ant clean jar
+               ${ANT_BIN} clean jar
 
                # Save status
                STATUS="$?"
@@ -27,13 +33,13 @@ for DIST in ${LIST}; do
                if [ "${STATUS}" != "0" ]
                then
                        # This has failed, so try "dist"
-                       ant clean dist
+                       ${ANT_BIN} clean dist
                        STATUS="$?"
 
                        # Still failing? Oh, to bad
                        if [ "${STATUS}" != "0" ]
                        then
-                               echo "$0: Failed to build '${DIST}'."
+                               echo "$0: Failed to build '${project}'."
                                exit 1
                        fi
                fi
@@ -41,10 +47,10 @@ for DIST in ${LIST}; do
 
        if [ ! -f "./dist.sh" ]
        then
-               echo "$0: Project '${DIST}' has no dist.sh"
+               echo "$0: Project '${project}' has no dist.sh"
        elif [ ! -e "./dist.sh" ]
        then
-               echo "$0: Error: Project '${DIST}' has non-executable dist.sh!"
+               echo "$0: Error: Project '${project}' has non-executable dist.sh!"
                exit 1
        else
                ./dist.sh
index 41cb9d6..ad4d9b6 100755 (executable)
@@ -7,17 +7,17 @@ for project in ${LIST}; do
        then
                echo "$0: Skipping jprojects-scripts ..."
                continue
-       elif [ -f "${project}/dist.sh" ]
+       elif [ -f "${JPROJECTS_HOME}/${project}/dist.sh" ]
        then
                echo "$0: Copying dist.sh to '${project}' ..."
-               cp -v dist.sh "${project}/" || exit 255
+               cp -v dist.sh "${JPROJECTS_HOME}/${project}/" || exit 255
        fi
 
-       if [ ! -d "${project}/docs" -o "$1" = "f" ]
+       if [ -d "${JPROJECTS_HOME}/${project}" -a ! -d "${JPROJECTS_HOME}/${project}/docs" -o "$1" = "f" ]
        then
                echo "$0: GNU-ifying project '${project}' ..."
-               mkdir --parent "${project}/docs" || exit 255
-               cp -rpv docs/* "${project}/docs/" || exit 255
+               mkdir --parent "${JPROJECTS_HOME}/${project}/docs" || exit 255
+               cp -rpv docs/* "${JPROJECTS_HOME}/${project}/docs/" || exit 255
                cd "${JPROJECTS_HOME}/${project}"
                echo "$0: git add ..."
                git add docs || exit 255
diff --git a/dist.sh b/dist.sh
index 101a0f4..54fcb45 100755 (executable)
--- a/dist.sh
+++ b/dist.sh
@@ -24,6 +24,9 @@ GLASSFISH_SSH_PATH="/var/payara/domains/domain1/lib"
 # Remote SSH server (password-less access)
 GLASSFISH_SSH_SERVER="www.mxchange.org"
 
+# Windows personal domain
+PERSONAL_DOMAIN_PATH="${HOME}/personal_domain/lib"
+
 # Generate list
 LIST=`find ../*/lib/${NAME}.jar`
 LIST="${LIST} `find ../*/*-ejb/lib/${NAME}.jar`"
@@ -35,6 +38,12 @@ then
        LIST="${LIST} ${GLASSFISH_BASE_PATH}"
 fi
 
+if [ -d "${PERSONAL_DOMAIN_PATH}" ]
+then
+       echo "$0: Personal domain found, adding to LIST ..."
+       LIST="${LIST} ${PERSONAL_DOMAIN_PATH}"
+fi
+
 if [ ! -f "${DIST}" ]
 then
        echo "$0: '${DIST}' not found."
@@ -48,16 +57,16 @@ then
        mkdir -vp "${WILDFLY_MODULE_PATH}"
 fi
 
-for target in ${LIST};
+for project in ${LIST};
 do
-       if [ -d "${target}" ]
+       if [ -d "${project}" ]
        then
-               cp -v "${DIST}" "${target}"
-       elif [ -f "${target}" ]
+               cp -v "${DIST}" "${project}"
+       elif [ -f "${project}" ]
        then
-               cp -v "${DIST}" "${target}"
+               cp -v "${DIST}" "${project}"
        else
-               echo "$0: Target '${target}' not found."
+               echo "$0: Project '${project}' not found."
        fi
 
 done
index 7f87871..bca9694 100755 (executable)
@@ -2,18 +2,23 @@
 
 . ./.jprojects.sh || exit 255
 
-for ENTRY in ${LIST}; do
-       cd "${ENTRY}" || exit 255
+for project in ${LIST}; do
+       if [ ! -d "${JPROJECTS_HOME}/${project}" ]
+       then
+               echo "$0: Project '${project}' does not exist."
+               continue;
+       fi
+
+       cd "${JPROJECTS_HOME}/${project}" || exit 255
 
        if [ "$1" = "c" ]
        then
-               echo "$0: Checkout '${ENTRY}' ..."
+               echo "$0: Checkout '${project}' ..."
                git checkout -- .
        fi
 
-       echo "$0: Pulling '${ENTRY}' ..."
+       echo "$0: Pulling '${project}' ..."
        git pull transport master || exit 255
-       echo "$0: Rebasing '${ENTRY}' ..."
+       echo "$0: Rebasing '${project}' ..."
        git rebase origin/master || exit 255
-       cd -
 done
index 2fe7e2b..2c6f520 100755 (executable)
@@ -17,6 +17,12 @@ then
 fi
 
 for project in ${LIST}; do
+       if [ ! -d "${JPROJECTS_HOME}/${project}" ]
+       then
+               echo "$0: Project '${project}' does not exist."
+               continue;
+       fi
+
        echo "$0: Processing '${project}',mode='$1' ..."
        cd "${JPROJECTS_HOME}/${project}" || exit 255