You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Scott M Stark <st...@attglobal.net> on 2000/02/26 03:19:18 UTC

Using bash scripts on Windows

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}



Re: Using bash scripts on Windows

Posted by Scott M Stark <st...@attglobal.net>.
If you don't think there is sufficient utility don't bother. Its not a big
deal.

----- Original Message -----
From: "James Duncan Davidson" <ja...@eng.sun.com>
To: <an...@jakarta.apache.org>
Sent: Saturday, February 26, 2000 3:20 PM
Subject: Re: Using bash scripts on Windows


> I used to use bash, then ksh on my windoze machines. But finally I got
tired
> of fighting all teh sort of imcompatibilities involved. Anyway, I'm ok
with
> this going into a contrib type area, but I think that we need to keep the
> number of entry points in the main distrubution to a minimum, esp since
most
> windows users are using plain ol cmd.exe
>
> .duncan
>



Re: Using bash scripts on Windows

Posted by James Duncan Davidson <ja...@eng.sun.com>.
> 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?

I used to use bash, then ksh on my windoze machines. But finally I got tired
of fighting all teh sort of imcompatibilities involved. Anyway, I'm ok with
this going into a contrib type area, but I think that we need to keep the
number of entry points in the main distrubution to a minimum, esp since most
windows users are using plain ol cmd.exe

.duncan