#!/bin/bash
-# Tools repository
-LIST="jprojects-scripts"
+# Tools repository (this)
+THIS="jprojects-scripts"
# Libraries and EJBs
-LIST="${LIST} \
- jcore jcoreee \
+LIBRARIES="jcore jcoreee \
jcore-logger-lib jcore-logger-ejb \
jcountry-core jcountry-lib \
jphone-core jphone-lib \
jshop-receipt-lib jshop-receipt-ejb"
# Applications and their special libs/EJBs
-LIST="${LIST}
- pizzaservice-core pizzaservice-lib pizzaservice-mailer pizzaservice-ejb pizzaservice-swing \
+APPLICATIONS="pizzaservice-core pizzaservice-lib pizzaservice-mailer pizzaservice-ejb pizzaservice-swing \
jjobs-core jjobs-lib jjobs-mailer jjobs-ejb jjobs-war jjobs \
- jrecruiter-core jrecruiter-lib jrecruiter-mailer jrecruiter-ejb jrecruiter-war jrecruiter \
+ addressbook-core addressbook-lib addressbook-mailer addressbook-ejb addressbook-war addressbook addressbook-uml"
+
+# Company-specific projects
+COMPANY_APPS="jrecruiter-core jrecruiter-lib jrecruiter-mailer jrecruiter-ejb jrecruiter-war jrecruiter \
jratecalc-core jratecalc-lib jratecalc-mailer jratecalc-ejb jratecalc-war jratecalc \
jlandingpage-core jlandingpage-lib jlandingpage-mailer jlandingpage-ejb jlandingpage-war jlandingpage \
jcalculator-core jcalculator-lib jcalculator-mailer jcalculator-ejb jcalculator-war jcalculator \
- jreports-core jreports-lib jreports-mailer jreports-ejb jreports-war jreports \
- addressbook-core addressbook-lib addressbook-mailer addressbook-ejb addressbook-war addressbook addressbook-uml"
+ jreports-core jreports-lib jreports-mailer jreports-ejb jreports-war jreports"
-# BROKEN:
-LIST="${LIST} addressbook-swing pizzaservice-war pizzaservice"
+# Broken (needs fixing)
+BROKEN="addressbook-swing pizzaservice-war pizzaservice"
+
+# Compile list
+ALL_PROJECTS="${THIS} ${LIBRARIES} ${APPLICATIONS} ${COMPANY_APPS} ${BROKEN}"
# Own home directory
declare -r JPROJECTS_HOME="${PWD}"
# ant binary
-ANT_BIN=`which ant 2>/dev/null`
+ANT_BIN=$(which ant 2>/dev/null)
+
+# Check binary
+if [ -z "${ANT_BIN}" ]
+then
+ echo "$0: Cannot find ANT binary."
+ exit 1
+fi
# Test on .git availability"
-for project in ${LIST}; do
+LIST=""
+for project in ${ALL_PROJECTS}; do
if [ ! -d "${project}" ]
then
echo "$0: Project '${project}' not created."
echo "$0: Project '${project}' is no GIT project."
exit 1
fi
+
+ # Add it as available
+ LIST="${LIST} ${project}"
done