added jfinancials which will be a project based on Addressbok (with addressbook
[jprojects-scripts.git] / build-dist-all.sh
index 173810702ae30242f97be338c209f4b172f8d3db..c5ae10febf7425071e9b9dbf07be4e23571cca01 100755 (executable)
@@ -2,9 +2,19 @@
 
 . ./.jprojects.sh || exit 255
 
 
 . ./.jprojects.sh || exit 255
 
-for DIST in ${LIST}; do
-       echo "$0: Executing '${DIST}' ..."
-       P=${DIST%/*}
+for project in ${LIST}; do
+       if [ "${project}" = "jprojects-scripts" ]
+       then
+               echo "$0: Skipping jprojects-scripts ..."
+               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
 
        echo "$0: P='${P}'"
        cd "${JPROJECTS_HOME}/${P}" || exit 255
@@ -15,10 +25,10 @@ for DIST in ${LIST}; do
                continue
        fi
 
                continue
        fi
 
-       if [ "$1" != "d" ]
+       if [ -x "${ANT_BIN}" -a "$1" != "d" ]
        then
                # Cleanup project and build JAR
        then
                # Cleanup project and build JAR
-               ant clean jar
+               ${ANT_BIN} clean jar
 
                # Save status
                STATUS="$?"
 
                # Save status
                STATUS="$?"
@@ -27,13 +37,13 @@ for DIST in ${LIST}; do
                if [ "${STATUS}" != "0" ]
                then
                        # This has failed, so try "dist"
                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
                        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
                                exit 1
                        fi
                fi
@@ -41,13 +51,18 @@ for DIST in ${LIST}; do
 
        if [ ! -f "./dist.sh" ]
        then
 
        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
        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
                exit 1
        else
-               ./dist.sh
+               if [ "$1" = "r" ]
+               then
+                       ./dist.sh r
+               else
+                       ./dist.sh
+               fi
        fi
 done
 
        fi
 done