rewrote list of projects:
authorRoland Häder <roland@mxchange.org>
Mon, 3 Apr 2017 12:40:46 +0000 (14:40 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 10 Apr 2017 13:47:23 +0000 (15:47 +0200)
THIS = *this* very project
LIBRARIES = "generic" (non-application-specific libraries)
APPLICATIONS = GNU GPL projects
COMPANY_APPS = Company-specific (close-source) projects
BROKEN = Broken projects (needs to be fixed later on)

Signed-off-by: Roland Häder <roland@mxchange.org>
.jprojects.sh

index bd8830b..e3a416a 100644 (file)
@@ -1,11 +1,10 @@
 #!/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 \
@@ -21,27 +20,39 @@ LIST="${LIST} \
        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."
@@ -50,4 +61,7 @@ for project in ${LIST}; do
                echo "$0: Project '${project}' is no GIT project."
                exit 1
        fi
+
+       # Add it as available
+       LIST="${LIST} ${project}"
 done