d849f66215c4c3ab9abb429ee469e69483e1af77
[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
30 # Broken (needs fixing)
31 BROKEN="addressbook-swing pizzaservice-war pizzaservice"
32
33 # Compile list
34 ALL_PROJECTS="${THIS} ${LIBRARIES} ${APPLICATIONS} ${COMPANY_APPS} ${BROKEN}"
35
36 # Own home directory
37 declare -r JPROJECTS_HOME="${PWD}"
38
39 # ant binary
40 ANT_BIN=$(which ant 2>/dev/null)
41
42 # Check binary
43 if [ -z "${ANT_BIN}" ]
44 then
45         echo "$0: Cannot find ANT binary."
46         exit 1
47 fi
48
49 # Test on .git availability"
50 LIST=""
51 for project in ${ALL_PROJECTS}; do
52         if [ ! -d "${project}" ]
53         then
54                 echo "$0: Project '${project}' not created."
55         elif [ ! -f "${project}/.git/config" ]
56         then
57                 echo "$0: Project '${project}' is no GIT project."
58                 exit 1
59         fi
60
61         # Add it as available
62         LIST="${LIST} ${project}"
63 done