/[pkg-jboss]/jboss3/j2ee/build.sh
ViewVC logotype

Contents of /jboss3/j2ee/build.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (hide annotations) (download) (as text) (vendor branch)
Thu Mar 25 21:44:33 2004 UTC (9 years, 1 month ago) by codeshark-guest
Branch: jboss, MAIN
CVS Tags: debian_version_3_2_4_final-1, debian_version_3_2_4_final-2, jboss-3-2-4, jboss-3-2-5, jboss-3-2-4-rc1, HEAD
Changes since 1.1: +0 -0 lines
File MIME type: application/x-sh
Initial import from jboss-3.2.4RC1-src.tar.gz
1 codeshark-guest 1.1 #!/bin/sh
2     ### ====================================================================== ###
3     ## ##
4     ## This is the main entry point for the build system. ##
5     ## ##
6     ## Users should be sure to execute this file rather than 'ant' to ensure ##
7     ## the correct version is being used with the correct configuration. ##
8     ## ##
9     ### ====================================================================== ###
10    
11     # $Id: build.sh,v 1.1.1.1 2004/03/25 21:44:33 codeshark-guest Exp $
12    
13     PROGNAME=`basename $0`
14     DIRNAME=`dirname $0`
15     GREP="grep"
16     ROOT="/"
17    
18     # Ignore user's ANT_HOME if it is set
19     ANT_HOME=""
20    
21     # the default search path for ant
22     ANT_SEARCH_PATH="\
23     tools
24     tools/ant \
25     tools/apache/ant \
26     ant"
27    
28     # the default build file name
29     ANT_BUILD_FILE="build.xml"
30    
31     # the default arguments
32     ANT_OPTIONS="-find $ANT_BUILD_FILE"
33    
34     # Use the maximum available, or set MAX_FD != -1 to use that
35     MAX_FD="maximum"
36    
37     # OS specific support (must be 'true' or 'false').
38     cygwin=false;
39     darwin=false;
40     case "`uname`" in
41     CYGWIN*)
42     cygwin=true
43     ;;
44    
45     Darwin*)
46     darwin=true
47     ;;
48     esac
49    
50     # the jaxp parser to use
51     if [ "x$JAXP" = "x" ]; then
52     # Default to xerces
53     JAXP="xerces"
54     fi
55    
56     #
57     # Helper to complain.
58     #
59     die() {
60     echo "${PROGNAME}: $*"
61     exit 1
62     }
63    
64     #
65     # Helper to complain.
66     #
67     warn() {
68     echo "${PROGNAME}: $*"
69     }
70    
71     #
72     # Helper to source a file if it exists.
73     #
74     maybe_source() {
75     for file in $*; do
76     if [ -f "$file" ]; then
77     . $file
78     fi
79     done
80     }
81    
82     search() {
83     search="$*"
84     for d in $search; do
85     ANT_HOME="`pwd`/$d"
86     ANT="$ANT_HOME/bin/ant"
87     if [ -x "$ANT" ]; then
88     # found one
89     echo $ANT_HOME
90     break
91     fi
92     done
93     }
94    
95     #
96     # Main function.
97     #
98     main() {
99     # if there is a build config file. then source it
100     maybe_source "$DIRNAME/build.conf" "$HOME/.build.conf"
101    
102     # Increase the maximum file descriptors if we can
103     if [ $cygwin = "false" ]; then
104     MAX_FD_LIMIT=`ulimit -H -n`
105     if [ $? -eq 0 ]; then
106     if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
107     # use the system max
108     MAX_FD="$MAX_FD_LIMIT"
109     fi
110    
111     ulimit -n $MAX_FD
112     if [ $? -ne 0 ]; then
113     warn "Could not set maximum file descriptor limit: $MAX_FD"
114     fi
115     else
116     warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT"
117     fi
118     fi
119    
120     # try the search path
121     ANT_HOME=`search $ANT_SEARCH_PATH`
122    
123     # try looking up to root
124     if [ "x$ANT_HOME" = "x" ]; then
125     target="build"
126     _cwd=`pwd`
127    
128     while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
129     cd ..
130     cwd=`pwd`
131     ANT_HOME=`search $ANT_SEARCH_PATH`
132     done
133    
134     # make sure we get back
135     cd $_cwd
136    
137     if [ "$cwd" != "$ROOT" ]; then
138     found="true"
139     fi
140    
141     # complain if we did not find anything
142     if [ "$found" != "true" ]; then
143     die "Could not locate Ant; check \$ANT or \$ANT_HOME."
144     fi
145     fi
146    
147     # make sure we have one
148     ANT=$ANT_HOME/bin/ant
149     if [ ! -x "$ANT" ]; then
150     die "Ant file is not executable: $ANT"
151     fi
152    
153     # specify the jaxp parser impls to use
154     case "$JAXP" in
155     crimson)
156     JAXP_DOM_FACTORY="org.apache.crimson.jaxp.DocumentBuilderFactoryImpl"
157     JAXP_SAX_FACTORY="org.apache.crimson.jaxp.SAXParserFactoryImpl"
158     ;;
159    
160     xerces)
161     JAXP_DOM_FACTORY="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"
162     JAXP_SAX_FACTORY="org.apache.xerces.jaxp.SAXParserFactoryImpl"
163     ;;
164     esac
165    
166     if [ "x$JAXP_DOM_FACTORY" != "x" ]; then
167     ANT_OPTS="$ANT_OPTS -Djavax.xml.parsers.DocumentBuilderFactory=$JAXP_DOM_FACTORY"
168     fi
169     if [ "x$JAXP_SAX_FACTORY" != "x" ]; then
170     ANT_OPTS="$ANT_OPTS -Djavax.xml.parsers.SAXParserFactory=$JAXP_SAX_FACTORY"
171     fi
172    
173     # need to specify planet57/buildmagic protocol handler package
174     ANT_OPTS="$ANT_OPTS -Djava.protocol.handler.pkgs=org.jboss.net.protocol"
175    
176     # setup some build properties
177     ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
178    
179     # change to the directory where the script lives so users are not forced
180     # to be in the same directory as build.xml
181     cd $DIRNAME
182    
183     # export some stuff for ant
184     export ANT ANT_HOME ANT_OPTS
185    
186     # execute in debug mode, or simply execute
187     if [ "x$ANT_DEBUG" != "x" ]; then
188     /bin/sh -x $ANT $ANT_OPTIONS "$@"
189     else
190     exec $ANT $ANT_OPTIONS "$@"
191     fi
192     }
193    
194     ##
195     ## Bootstrap
196     ##
197    
198     main "$@"

  ViewVC Help
Powered by ViewVC 1.1.5