e3a416ab3f880359d1655be8f4a3f6bc77c5c72a
[jprojects-scripts.git] / .jprojects.sh
1 #!/bin/bash
2
3 # Tools repository (this)
4 THIS="jprojects-scripts"
5
6 # Libraries and EJBs
7 LIBRARIES="jcore jcoreee \
8         jcore-logger-lib jcore-logger-ejb \
9         jcountry-core jcountry-lib \
10         jphone-core jphone-lib \
11         jcontacts-core jcontacts-business-core jcontacts-lib \
12         juser-core juser-lib \
13         juser-activity-core juser-activity-lib \
14         jletter-core jletter-lib jletter-ejb \
15         jaddressbook-core jaddressbook-lib \
16         jmailer-ee \
17         jcore-swing \
18         jcustomer-core jcustomer-lib \
19         jshop-core jshop-ee-lib jshop-ejb \
20         jshop-receipt-lib jshop-receipt-ejb"
21
22 # Applications and their special libs/EJBs
23 APPLICATIONS="pizzaservice-core pizzaservice-lib pizzaservice-mailer pizzaservice-ejb pizzaservice-swing \
24         jjobs-core jjobs-lib jjobs-mailer jjobs-ejb jjobs-war jjobs \
25         addressbook-core addressbook-lib addressbook-mailer addressbook-ejb addressbook-war addressbook addressbook-uml"
26
27 # Company-specific projects
28 COMPANY_APPS="jrecruiter-core jrecruiter-lib jrecruiter-mailer jrecruiter-ejb jrecruiter-war jrecruiter \
29         jratecalc-core jratecalc-lib jratecalc-mailer jratecalc-ejb jratecalc-war jratecalc \
30         jlandingpage-core jlandingpage-lib jlandingpage-mailer jlandingpage-ejb jlandingpage-war jlandingpage \
31         jcalculator-core jcalculator-lib jcalculator-mailer jcalculator-ejb jcalculator-war jcalculator \
32         jreports-core jreports-lib jreports-mailer jreports-ejb jreports-war jreports"
33
34 # Broken (needs fixing)
35 BROKEN="addressbook-swing pizzaservice-war pizzaservice"
36
37 # Compile list
38 ALL_PROJECTS="${THIS} ${LIBRARIES} ${APPLICATIONS} ${COMPANY_APPS} ${BROKEN}"
39
40 # Own home directory
41 declare -r JPROJECTS_HOME="${PWD}"
42
43 # ant binary
44 ANT_BIN=$(which ant 2>/dev/null)
45
46 # Check binary
47 if [ -z "${ANT_BIN}" ]
48 then
49         echo "$0: Cannot find ANT binary."
50         exit 1
51 fi
52
53 # Test on .git availability"
54 LIST=""
55 for project in ${ALL_PROJECTS}; do
56         if [ ! -d "${project}" ]
57         then
58                 echo "$0: Project '${project}' not created."
59         elif [ ! -f "${project}/.git/config" ]
60         then
61                 echo "$0: Project '${project}' is no GIT project."
62                 exit 1
63         fi
64
65         # Add it as available
66         LIST="${LIST} ${project}"
67 done