I am still new to Ant, so I did not know about these classes. Sounds good. I will try to have a look at it when I have some more time.
Thanks
Jean-Noel
-----Original Message-----
From: Stefan Bodewig [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 31, 2000 6:11 AM
To: [EMAIL PROTECTED]
Subject: Re: Platform independend classpath in build.xml?
>>>>> "JG" == Jean-Noel Gadreau <[EMAIL PROTECTED]> writes:
JG> Moreover, I think the same problem will arise for other path
JG> (like for .DLL or .so needed by some JNI classes for
JG> instance). How about defining a task that is able to add path to
JG> a list in a crossplatform way, which would not be limited just to
JG> CLASSPATH. This way, if you need to specify PATH (to find a tool
JG> or something), we could use the same class.
Please let's not reinvent the wheel. Thomas Haas has built what you're
describing and has sent it as part of our JUnit task.
The current implementation consists of two classes Path and
PathElement. Citing from his javadocs - deHTMLed for readability:
/**
* This object represents a path as used by CLASSPATH or PATH
* environment variable.
*
* It consists of a list of <code>PathElement</code> and <code>Path</code>
* objects. It is used to represent a classpath or path like nested parameters
* in task definitions:
*
* <code>
* <sometask><br>
* <somepath>
* <element location="/path/to/file.jar" />
* <element path="/path/to/file2.jar:/path/to/class2;/path/to/class3" />
* <element location="/path/to/file3.jar" />
* <element location="/path/to/file4.jar" />
* </somepath>
* </sometask><br>
* </code>
*
* The object implemention <code>sometask</code> must provide a method called
* <code>createSomepath</code> which returns an instance of <code>Path</code>.
* Nested path definitions are handled by the Path object and must be labeled
* <code>path</code>.<p>
*
* The path element takes a parameter <code>path</code> which will be parsed
* and split into <code>PathElement</code> objects. It will usually be used
* to define a path from an environment variable.
*
* @author [EMAIL PROTECTED]
*/
This class takes care of all the platform dependent stuff.
using this and nested elements wherever path like structures are
needed should suffice.
Thomas is on vacation AFAIK but I hope he will get back to this
soon. Thomas is a commiter so he can make these changes quicker than I
could put together the necessary patch.
Stefan
