PC Review


Reply
Thread Tools Rate Thread

How did Nant achieve this in C#?

 
 
=?Utf-8?B?Q2h1YSBXZW4gQ2hpbmc=?=
Guest
Posts: n/a
 
      12th Jan 2005
Hi there,

I try to find on the internet on how to achieve this, but still can't find
any good resources till i downloaded Nant.

But there are too many codes inside Nant, and i have no idea which part of
Nant code that can achieve this below.

<?xml version="1.0"?>
<project name="Property Test" default="test" basedir=".">
<property name="project.name" value="PropertyTest"/>
<property name="project.version" value="1.0.0"/>
<target name="test">
<echo message="Building ${project.name}-${project.version}"/>
</target>
</project>

--> I want to get the value of project.name. So i can use the
${project.name} a few times in my xml script.

Any idea on how to achieve this?

Thanks.
--
Regards,
Chua Wen Ching
Visit us at http://www.necoders.com
 
Reply With Quote
 
 
 
 
Daniel O'Connell [C# MVP]
Guest
Posts: n/a
 
      12th Jan 2005

"Chua Wen Ching" <(E-Mail Removed)> wrote in message
news:CBFD2181-8378-45A8-95F6-(E-Mail Removed)...
> Hi there,
>
> I try to find on the internet on how to achieve this, but still can't find
> any good resources till i downloaded Nant.
>
> But there are too many codes inside Nant, and i have no idea which part of
> Nant code that can achieve this below.
>
> <?xml version="1.0"?>
> <project name="Property Test" default="test" basedir=".">
> <property name="project.name" value="PropertyTest"/>
> <property name="project.version" value="1.0.0"/>
> <target name="test">
> <echo message="Building ${project.name}-${project.version}"/>
> </target>
> </project>
>
> --> I want to get the value of project.name. So i can use the
> ${project.name} a few times in my xml script.
>
> Any idea on how to achieve this?


When you are reading your xml file, when you hit a property tag simply add
that property's name and value to a dictionary and look it up when your
script references it.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OT: Nant + VB 3.0 / 3.0 Rory Becker Microsoft VB .NET 2 21st Nov 2007 01:02 PM
NAnt for .net 2.0 sireesha.parvatham@gmail.com Microsoft ASP .NET 1 27th Apr 2006 04:47 PM
NANT for ASP.NET 2.0 prabhupr@hotmail.com Microsoft ASP .NET 2 23rd Nov 2005 09:51 PM
NAnt knowledge Frank Rizzo Microsoft C# .NET 2 18th Feb 2005 09:46 PM
Anyone using NAnt george r smith Microsoft C# .NET 2 23rd Jul 2003 06:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:43 AM.