On 6/21/06, Rod Ayers <[EMAIL PROTECTED]> wrote:
Hi, Gary....

I'm intrigued how you would implement the "XML approach".  Probably so easy
I've totall yoverlooked it....  :):)

Thanks!
Rod

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto: [EMAIL PROTECTED]] On Behalf Of Gary Feldman
Sent: Tuesday, June 13, 2006 9:49 AM
To: Ramya Niranjan
Cc: [email protected]
Subject: Re: [NAnt-users] Setting property after reading from a file.

Ramya Niranjan wrote:
> I have a text file info.txt that contains some version specific
> information like:
> MAJORVERSION= 4.0
> MINORVERSION=11
> BRANCHINFO=COR
>
> What I need to do is create some properties like majorversion,
> minorversion and branchinfo in NAnt and assign these values after
> reading from the txt file. In short, whenever there is a change in the
> version or branch value, I should change only this text file and not
> the build file. Is this possible?
>
> I have tried using foreach item=Line in filename property=some value,
> but this only sets the last value to the property as the previous 2
> value get overwritten. Loadfile is also not of much help.
To do it that way, you'd obviously have to parse the line that you read in
order to extract the correct property name.

But you'd be much better off either storing this information in XML or using
the response file technique suggested by Rod Ayers.  The advantage of the
XML approach is that it avoids the readonly issue, and it is easier to just
automatically update one entry without having to update the entire file.
The advantage of the response file approach is that it's easier to
understand, read, and get working in the first place.

Gary




_______________________________________________
NAnt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users



All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
NAnt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NAnt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to