]> git.mxchange.org Git - jprojects-scripts.git/commitdiff
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 c2178e1014a4697a9e166c2a62c425098bcd7f82..ae46e9264c8865fa17893850806c2e8e1d1f737a 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 173810702ae30242f97be338c209f4b172f8d3db..5ac2a3e6fe165fbb4772a9abbcea01979f5d57bc 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 41cb9d6ae45e25c84481bab955782c7c861277d6..ad4d9b6e328bbb118a91df9d48cf1e66b1b85561 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 101a0f4222f1be73238bfcd5186daa9ed57994f2..54fcb45ee6d5934048cb19c4ca4aff6d565785a4 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 7f87871af1e076e39093a229afba3070060c3947..bca96943000365aec93aa476fb188e2b134ebbba 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 2fe7e2b1ff08c6fad1dc3d9e680f22e1ddd3b0c4..2c6f5209b4f4e448f26c69c442febd15ec77d4ef 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