ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Weiqi Gao <weiqi...@networkusa.net>
Subject Re: Anyone run Cygnus Win32 tools?
Date Sat, 28 Oct 2000 02:52:29 GMT
Peter Donald wrote:
> 
> could someone who runs win32 and has cygnus installed check if the
> following will actually work. I had a request for this but I don't use the
> platform so .... ;)
> 
> ----Change <jakarta-ant>/bin/ant----
> if [ "$CLASSPATH" != "" ] ; then
> 
>   if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
>      CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
>   fi
> 
>   LOCALCLASSPATH=$LOCALCLASSPATH:$CLASSPATH
> 
> fi# convert the existing path to unix

The cygwin platform is a tricky situation in that Cygwin makes most
thing Unixish, yet the JDK remains a Windows JDK (I'm using the Sun JDK
1.3 for Windows, other brand of compilers may behave differently).  The
java command in the JDK expacts classpaths to be a semicolon-separated
list of directories and jar files or zip files.  The above fragment
attempts to turn the classpath into a colon-separated list, which will
for sure confuse javac.

On my machine, with the above patch, the final command executed is:

java -classpath .:/cygdrive/d/Program
Files/JavaSoft/Jaxp1.0/jaxp.jar:/cygdrive/d/Program
Files/JavaSoft/Jaxp1.0/parser.jar:/cygdrive/d/j2sdkee1.2.1/lib/j2ee.jar:/opt/xalan-1.2/xalan.jar:/opt/xalan-1.2/xerces.jar:/opt/xalan-1.2/bsf.jar:/opt/httpunit-1.1/lib/httpunit.jar:/opt/httpunit-1.1/lib/Tidy.jar:/opt/junit3.2/junit.jar:/opt/rhino/js.jar:d:\opt\ant-1.2/lib/ant.jar:d:\opt\ant-1.2/lib/jaxp.jar:d:\opt\ant-1.2/lib/optional.jar:d:\opt\ant-1.2/lib/parser.jar:D:\jdk1.3/lib/tools.jar
-Dant.home=d:\opt\ant-1.2 org.apache.tools.ant.Main

Notice:
1.  The lack of double quotes arround the entire classpath.
2.  The presence of the funny looking /cygdrive/d/ deal, cygwin's name
for D:\
3.  The d:\opt\ant-1.2/lib/jaxp.jar entry.  The java command would have
been OK with this has the path separator been the semicolon.  (It
doesn't care which way the slash goes.)  This is the part that is build
with the help of a  | tr " " ":".

The Conclusion: Use the ant.bat that is provided.  If you don't want to
type the .bat part, which Cygwin forces you to type, you can always
create a symbolic link named ant that points at ant.bat, which,
fortunately, Cygwin allows you to do.

--
Weiqi Gao
weiqigao@networkusa.net

Mime
View raw message