I think the problem is not so much discovering the path separator for the
current platform, the problem is that you want to write a generic build.xml
for all platforms, so a standard separator needs to be used.
One alternative is to add an attribute that specifies what the separator is
for tasks that need to parse list of dirs/files. Or perhaps a global
property that defines one.
Tom Cook wrote:
>
> On Wed, 10 May 2000, Vitaly Stulsky wrote:
>
> [snip]
> > 2) With applied patch it is possible to use such src dirs:
> > <property name="src.dir"
> > value= "com/company/progr/mainprogr;
> > com/company/utils/protocol;
> > com/company/utils/db;
> > com/company/utils/diag;
> > com/company/utils/html;
> > com/company/utils/sort;
> > com/company/utils/string;
> > com/company/utils/thread;
> > com/company/utils/test;
> > com/company/utils/timer
> > />
> > All paths must be separated by semicolon ( I estimate Unix users indignation,
> > but now current
> > approach easily extended to usage semicolon on NT platform and colon on
> > Unix).
>
> There is a very standard mechanism in Java for discovering the path
> separator:
>
> package java.io;
> ...
> public class File
> {
> public static String pathSeparator;
> public static char pathSeparatorChar;
> ...
> }
>
> This is hardly a hard interface to use, instead of hard-coding...
>
> --
> Tom Cook - Software Engineer
>
> "The brain is a wonderful organ. It starts functioning the moment you get
> up in the morning, and does not stop until you get into the office."
> - Robert Frost
>
> LISAcorp - www.lisa.com.au
>
> --------------------------------------------------
> 38 Greenhill Rd. Level 3, 228 Pitt Street
> Wayville, SA, 5034 Sydney, NSW, 2000
>
> Phone: +61 8 8272 1555 Phone: +61 2 9283 0877
> Fax: +61 8 8271 1199 Fax: +61 2 9283 0866
> --------------------------------------------------
--
Eugene Bekker
Chief Architect
PowerVision Corporation
http://www.powervision.com
tel://410/312.7243 cel://443/838.6330
|