ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Tulley" <>
Subject Re: Refactor of PathTokenizer - am I missing something?
Date Fri, 04 Jan 2002 01:25:20 GMT
Actually I meant <javac>, sorry.
I've boiled it down to the following XML (pared down from my 2400 line
build file):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>

<project default="main" name="test">
  <target name="main" 
	  description="Compile all source files."/>

  <target name="init" >
    <property name="module.root" value="${basedir}"/>
    <property name="module.source" value="${module.root}/src"/>
    <property name="" value="${module.source}/main"/>
    <property name="module.output" value="${module.root}/output"/>
    <property name="build.classes" value="${module.output}/classes"/>

  <!-- Compile all class files -->
  <target name="compile-classes" depends="init">

    <mkdir dir="${build.classes}"/>
    <javac destdir="${build.classes}"
       <src path="${}"/>
       <classpath refid="javac.classpath"/>
       <include name="${javac.includes}"/>
       <exclude name="${javac.excludes}"/>

Nothing here uses any explicitly defined path, everything is relative
to ${basedir}.
I'm not sure if the UNIX-like path support on NetWare is exposed to the
JVM or not.  It is definitely not a often used feature, and one that you
have to explicitly enable(and I'm not sure at what cost).  

I'm not sure if the explicit search for a semi-colon at class
construction time will do the trick or not.  I have not narrowed down if
there is indeed more than one element in the path at the time or not. 
I'll stick your code in and see how it holds up against the unit tests
(with the additions I made recently).

Jeff Tulley  (
Novell, Inc., the leading provider of Net services software.

>>> 1/3/02 6:06:34 PM >>>
Hi Jeff,

I think I now have a better understanding of the problem ...

Jeff Tulley wrote:
> Bill,
>     One thing that you are missing here is the fact that it is not a
> build file directly that is triggering this problem, at least not in
> sense of the <path>, <classpath>,  and <pathelement> tags.  What is
> actually giving me grief is a <javadoc> task that uses

Okay, I didn't realize <javadoc> was the culprit.

>     It seems that I should support UNIX path names, since our OS has
> file mode that would allow you to reference our volumes in a
> manner.  (instead of sys:/temp, it would be /sys/temp, if I am not
> mistaken).

Okay, I didn't realize you could specify a NetWare volume with
syntax.  I'm assuming that's exposed to the JVM?

Here's another take at the problem.  Both ";" and ":" are supported
depending on whether a ";" is found anywhere in the path but not both
together.  Of course, the one limitation is the assumption that a
or directory can't contain a ";":

    public PathTokenizer(String path) {
        String tokens = ":;";
        // When running under NetWare, look for a ";" anywhere in the
path.  If not
        // found, assume a UNIX style path and use ":", otherwise use
as the
        // delimiter.
        if ( null != path && Os.isFamily("netware") ) {
            tokens = ( path.indexOf(';') == -1 ) ? ":" : ";";
        tokenizer = new StringTokenizer(path, tokens, false);
        dosStyleFilesystem = File.pathSeparatorChar == ';';

All of the following paths should be tokenized properly:

Hope this helps,

To unsubscribe, e-mail:  
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message