-if [ -n "$JAVA_HOME" ] ; then
- # OSX hack to make Ant work with jikes
- if $darwin ; then
- OSXHACK="${JAVA_HOME}/../Classes"
- if [ -d "${OSXHACK}" ] ; then
- for i in "${OSXHACK}"/*.jar
- do
- JIKESPATH="$JIKESPATH:$i"
- done
- fi
- fi
-fi
-
-# Allow Jikes support (off by default)
-if $usejikes; then
- ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes"
-fi
-
-# For Cygwin, switch paths to appropriate format before running java
-# For PATHs convert to unix format first, then to windows format to ensure
-# both formats are supported. Probably this will fail on directories with ;
-# in the name in the path. Let's assume that paths containing ; are more
-# rare than windows style paths on cygwin.
-if $cygwin; then
- if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
- format=mixed
- else
- format=windows
- fi
- ANT_HOME=`cygpath --$format "$ANT_HOME"`
- ANT_LIB=`cygpath --$format "$ANT_LIB"`
- JAVA_HOME=`cygpath --$format "$JAVA_HOME"`
- LCP_TEMP=`cygpath --path --unix "$LOCALCLASSPATH"`
- LOCALCLASSPATH=`cygpath --path --$format "$LCP_TEMP"`
- if [ -n "$CLASSPATH" ] ; then
- CP_TEMP=`cygpath --path --unix "$CLASSPATH"`
- CLASSPATH=`cygpath --path --$format "$CP_TEMP"`
- fi
- CYGHOME=`cygpath --$format "$HOME"`
-fi
-
-# Show script help if requested
-if $show_help ; then
- echo $0 '[script options] [options] [target [target2 [target3] ..]]'
- echo 'Script Options:'
- echo ' --help, --h print this message and ant help'
- echo ' --noconfig suppress sourcing of /etc/ant.conf,'
- echo ' $HOME/.ant/ant.conf, and $HOME/.antrc'
- echo ' configuration files'
- echo ' --usejikes enable use of jikes by default, unless'
- echo ' set explicitly in configuration files'
- echo ' --execdebug print ant exec line generated by this'
- echo ' launch script'
- echo ' '
-fi
-# add a second backslash to variables terminated by a backslash under cygwin
-if $cygwin; then
- case "$ANT_HOME" in
- *\\ )
- ANT_HOME="$ANT_HOME\\"
- ;;
- esac
- case "$CYGHOME" in
- *\\ )
- CYGHOME="$CYGHOME\\"
- ;;
- esac
- case "$JIKESPATH" in
- *\\ )
- JIKESPATH="$JIKESPATH\\"
- ;;
- esac
- case "$LOCALCLASSPATH" in
- *\\ )
- LOCALCLASSPATH="$LOCALCLASSPATH\\"
- ;;
- esac
- case "$CLASSPATH" in
- *\\ )
- CLASSPATH="$CLASSPATH\\"
- ;;
- esac
-fi
-# Execute ant using eval/exec to preserve spaces in paths,
-# java options, and ant args
-ant_sys_opts=
-if [ -n "$CYGHOME" ]; then
- if [ -n "$JIKESPATH" ]; then
- ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\" -Dcygwin.user.home=\"$CYGHOME\""
- else
- ant_sys_opts="-Dcygwin.user.home=\"$CYGHOME\""
- fi
-else
- if [ -n "$JIKESPATH" ]; then
- ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\""
- fi
-fi
-ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath \"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\" -Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"$CLASSPATH\" $ant_exec_args"
-if $ant_exec_debug ; then
- echo $ant_exec_command
-fi
-eval $ant_exec_command