You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Reuleaux, Andreas" <A....@klopotek.de> on 2000/12/13 15:41:20 UTC

calling ant from cygwin under win32

Hi ants,

I am using ant on a win32 System. The Scripts to call ant that come with the
current distribution include

  ant (formerly ant.sh)    ---    a (ba)sh - Skript for UNIX and
  ant.bat                        ---   for the win32 command line
interpreter

I am using cygwin as a better command line interpreter for win32 though,
that is the GNU utils including
bash ported to win32, see http://sources.redhat.com/cygwin

I find myself modifying the ant Skript to be suitable for cygwin each time a
new ant version gets out 
and I wonder if it wouldn't be possible to include such an **ant-cygwin**
Skript in the ant distibution.
Anyone interested will find some hints of what modifications I am using
below.
(I am not sure if alternatively it would be possible to have one single
Script the runs under unix and cygwin).

Andreas

--
Modifications for ant to make it suitable for cygwin:
  * replace ':' by ';' in the classpath as the java-interpreter under win32
wants the path elements separated by ';'
    (but is comfortable with forward slashes in the classpath like 
    -classpath d:/wherever/ant.jar;d:/wherever/blah.jar...)
  * whenever a path is expanded I use double quotes that is I replace
      LOCALCLASSPATH=$LOCALCLASSPATH;$JAVA_HOME/lib/tools.jar
    by 
      LOCALCLASSPATH="$LOCALCLASSPATH;$JAVA_HOME/lib/tools.jar"
    (don't really know why just found the difference is essential in order
to get things running)
  * haven't included the environment classpath $CLASSPATH yet.
  * in my bashrc I have the following settings:
      export JAVA_HOME="d:/jdk1.3"
      export ANT_HOME="d:/win32/ant/v1.2-bin-okt2000"
      export PATH="$PATH:/cygdrive/d/win32/ant/v1.2-bin-okt2000/bin" 
    Beware: :/cygdrive/d/ works for the path in cygwin-bash but confuses the
java-interpreter.