ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott M Stark" <star...@attglobal.net>
Subject Using bash scripts on Windows
Date Sat, 26 Feb 2000 02:19:18 GMT
I use bash on all windows platforms rather than the cmd shell. The only
problem
I ever have is java classpaths defined using ':' as the separater. Its a
simple change
to accomdate use of the ';' separater for the bash/NT situation. Below is a
modified bootstrap.sh that works with bash under unix and NT. Is it
worthwhile
to add this to the distribution?

# OS independent bash script
if [ -f $HOME/.antrc ] ; then
  . $HOME/.antrc
fi

if [ -z "${JAVA_HOME}" ] ; then
 echo JAVA_HOME must be set
 exit 1
fi

# Windows defines an OS env variable
if [ -z "${OS}" ] ; then
 CPS=":"
else
 CPS=";"
fi

SRCDIR=src/main/org/apache/tools
CLASSDIR=classes
CLASSPATH="${CLASSPATH}${CPS}${JAVA_HOME}/lib/classes.zip"
CLASSPATH="${CLASSPATH}${CPS}${JAVA_HOME}/lib/tools.jar"
CLASSPATH="${CLASSPATH}${CPS}lib/xml.jar${CPS}src/main${CPS}${CLASSDIR}"

mkdir -p ${CLASSDIR}

export CLASSPATH
echo CLASSPATH="$CLASSPATH"

javac  -d "${CLASSDIR}" ${SRCDIR}/tar/*.java
javac  -d "${CLASSDIR}" ${SRCDIR}/ant/*.java
javac  -d "${CLASSDIR}" ${SRCDIR}/ant/taskdefs/*.java

cp src/main/org/apache/tools/ant/taskdefs/defaults.properties
${CLASSDIR}/org/apache/tools/ant/taskdefs
cp src/main/org/apache/tools/ant/parser.properties
${CLASSDIR}/org/apache/tools/ant

java org.apache.tools.ant.Main main
java org.apache.tools.ant.Main clean

if test ! -d bin; then mkdir bin; fi
cp src/bin/antRun bin
chmod +x bin/antRun

rm -rf ${CLASSDIR}



Mime
View raw message