I think that Stefan is correct.
The macrodef
update-module-help
uses <property name="@{name}.dest"
location="${helpzips}/[EMAIL PROTECTED]" />
and on windows this will generate:
c:\helpzips\com_lgc_name_help.zip
assuming ${helpzips} is c:/helpzips and @{name} is name.in the javascript code, this string gets substituted into the code by the
macrodef:
file = project.resolveFile("c:\helpzips\com_lgc_name_help.zip");
This does not work of course.One may use a property as you have done to work around this. - this would be a valid use-case for local properties.
Alternativly you could use jython as the scripting language:
<script language="jython">
file = project.resolveFile(r"@{file}")
project.setNewProperty("@{property}", file.lastModified())
</script>The r"" raw-string notation is quite powerfull.
Peter
Dominique Devienne wrote:
From: Stefan Bodewig [mailto:[EMAIL PROTECTED]
On Mon, 8 Mar 2004, Dominique Devienne <[EMAIL PROTECTED]> wrote:
file = project.resolveFile("@{file}");
...
In the <last-modified> macro, when called from the other macro,Because it lives inside a JavaScript string and JavaScript uses
the file attribute has lost of its back-slashes '\'...
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}/[EMAIL PROTECTED]" />
into
<property name="@{name}.dest" value="${helpzips}/[EMAIL PROTECTED]" />
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
