Re: how to use property in echo

Bob Archer <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nant.user
Message-ID <[email protected]>
> I want to dynamic generate a nant file for nant task use. I use
> echo file to
> generate. But property change to value that I don't want.for
> example:
> <echo file="test.xml">&lt;property name=&quot;generateTime&quot;
> value=&quot;${datetime::now()}&quot;</echo>
> 
> test.xml would become like
> <property name="generateTime" value="2010 12 3 18:23">
> How can I let it become below
> <property name="generateTime" value="${datetime::now()}">
> Thanks.

I think if you separate it out then it should work.. something like:

<echo file="test.xml">&lt;property name=&quot;generateTime&quot; value=&quot;${"$" + "datetime::now()}"}&quot;</echo>

Although there may be some way to escape the ${} thing with a back slash or an extra $... but I'm too lazy to check the code. ;)

BOb


------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.