ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Problem with <macrodef> + <script language="javascript"> on W indo ws
Date Tue, 09 Mar 2004 09:59:45 GMT
> From: Stefan Bodewig [mailto:bodewig@apache.org]
> 
> On Mon, 8 Mar 2004, Dominique Devienne <DDevienne@lgc.com> wrote:
> 
> >           file = project.resolveFile("@{file}");
> ...
> 
> > In the <last-modified> macro, when called from the other macro,
> > the file attribute has lost of its back-slashes '\'...
> 
> Because it lives inside a JavaScript string and JavaScript uses
> backslashes as escape characters.  <macrodef> is only doing a textual
> replace.

What I don't understand is that the first macro I listed works
when used directly (i.e. when that macro is not used within another
macro). So I suspect it's the macro-within-macro has something to
do with it.

I haven't tried, but I'm pretty sure if I was to implement that
<last-modified> macro into a Java task, things would work as expected
which is why again I suspect <macrodef> to have something to do with
it... But of course I've been known to be wrong ;-)

> Turn
> >       <property name="@{name}.dest"
> >                 location="${helpzips}/com_lgc_@{name}_help.zip" />
> 
> into
> 
>       <property name="@{name}.dest"
>                 value="${helpzips}/com_lgc_@{name}_help.zip" />
> 
> It won't hurt since you are using project.resolveFile anyway and you
> don't have any backslashes in the string - unless the expanded
> helpzips property contains some.

It doesn't, which is why I used location. @{name}.dest is not used
only by the <last-modified> macro. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message