cleanup is now done separately and only if requested. Yes, getting messy ...
[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 \
15         jaddressbook-core jaddressbook-lib \
16         jmailer-ee \
17         jcore-swing \
18         jcustomer-core jcustomer-lib \
19         jproduct-core jproduct-lib \
20         jshop-core jshop-ee-lib \
21         jshop-receipt-lib"
22
23 # Applications and their special libs/EJBs
24 APPLICATIONS="pizzaservice-core pizzaservice-lib pizzaservice-mailer pizzaservice-ejb pizzaservice-swing \
25         jjobs-core jjobs-lib jjobs-mailer jjobs-ejb jjobs-war jjobs \
26         jfinancials-core jfinancials-lib jfinancials-mailer jfinancials-ejb jfinancials-war jfinancials
27         addressbook-core addressbook-lib addressbook-mailer addressbook-ejb addressbook-war addressbook addressbook-uml"
28
29 # Company-specific projects
30 COMPANY_APPS="jrecruiter-core jrecruiter-lib jrecruiter-mailer jrecruiter-ejb jrecruiter-war jrecruiter"
31
32 # Broken (needs fixing)
33 BROKEN="addressbook-swing jfinancials-swing pizzaservice-war pizzaservice"
34
35 # Compile list
36 ALL_PROJECTS="${THIS} ${LIBRARIES} ${APPLICATIONS} ${COMPANY_APPS} ${BROKEN}"
37
38 # Own home directory
39 declare -r JPROJECTS_HOME="${PWD}"
40
41 # ant binary
42 ANT_BIN=$(which ant 2>/dev/null)
43
44 # Check binary
45 if [ -z "${ANT_BIN}" ]
46 then
47         echo "$0: Cannot find ANT binary."
48         exit 1
49 fi
50
51 # Test on .git availability"
52 LIST=""
53 for project in ${ALL_PROJECTS}; do
54         if [ ! -d "${project}" ]
55         then
56                 echo "$0: Project '${project}' not created."
57         elif [ ! -f "${project}/.git/config" ]
58         then
59                 echo "$0: Project '${project}' is no GIT project."
60                 exit 1
61         fi
62
63         # Add it as available
64         LIST="${LIST} ${project}"
65 done