ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kitching Simon <Simon.Kitch...@orange.ch>
Subject RE: if basedir absolute file name then resolving file names cause s duplicate basedirs in resulting string
Date Fri, 18 Aug 2000 08:38:28 GMT
Yep, I found this one too. 

The following patch to taskdefs/Ant.java fixes the problem (though there may
be better fixes - I'm an ant newbie ;-)

To summarize the problem:

<ant antFile="/home/someuser/build.xml" .... />
or
<ant antFile="${some_dir}/build.xml" .... />

The above ant tasks generate bad antFile paths, because the path is
absolute. Currently,
only relative paths work, eg "antFile="../mybuildfile.cml" works ok.

Index: Ant.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,
v
retrieving revision 1.14
diff -r1.14 Ant.java
178c178
<             antFile = (new File(dir, antFile)).getAbsolutePath();
---
>             antFile = p1.resolveFile(antFile).getAbsolutePath();


> -----Original Message-----
> From:	Barrie Treloar [SMTP:Barrie.Treloar@camtech.com.au]
> Sent:	Friday, August 18, 2000 8:48 AM
> To:	Ant Developers Mailing List
> Subject:	if basedir absolute file name then resolving file names
> causes duplicate basedirs in resulting string
> 
> This has only just started to happen and I can't seem to find the
> reason for it.
> 
> When basedir is an absolute path all resolution of relative paths will
> cause the basedir to be appended twice to the path.
> 
> Does anyone else see this same problem? (from the latest CVS build)
> 
> Barrie
> --
> Barrie Treloar
> ____________________________________________________________________
> 
>   Barrie Treloar                      Phone: +61 8 8303 3300
>   Senior Analyst/Programmer           Fax:   +61 8 8303 4403 
>   Electronic Commerce Division        Email: barrie@camtech.com.au
>   Camtech (SA) Pty Ltd                http://www.camtech.com.au
>  --- Level 8, 10 Pulteney Street, Adelaide SA 5000, Australia. ---
> ____________________________________________________________________
> 

Mime
View raw message