473,385 Members | 1,324 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How did Nant achieve this in C#?

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
Nov 16 '05 #1
1 1190

"Chua Wen Ching" <ch************@nospam.hotmail.com> wrote in message
news:CB**********************************@microsof t.com...
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.
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: hoochiegooch | last post by:
Hi, all. I have a couple of questions about NAnt. 1. Is there a better way to invoke NAnt from a C# "Master Test Rig" than shelling out? IOW, how should an ASP.NET web app or Windows Service...
1
by: Nigel Currie | last post by:
Hi all, I'm having a problem with <nant> tasks to build sub-projects into an overall solution. I have the following directory structure: JobManagerSolution |_ | JobManager |_...
2
by: george r smith | last post by:
I am curious, anyone using NAnt and what are their opinions. thanks grs
2
by: HaukiDog | last post by:
Hi, I am trying to set up my C# web project to be compiled by NANT. Everything compiles and works fine within the IDE. I have a created a NANT build file which has a simple project tag, like...
0
by: muesliflakes | last post by:
I have figured out how to get this running by using Ant.Console as a starting point for calling NAnt. I had to include NAnt.Core, NAnt.DotNet & NDoc.Core in my project and it worked correctly. ...
2
by: Ireneus Broncel | last post by:
Maybe I am wrong here, but I have a problem with nant that I don't unterstand, I'm trying to compile an example ConsoleApp Project with net-1.1, and get the errror: log4net:ERROR LogLog:...
12
by: michael sorens | last post by:
So I have compiled a .dll file from a Visual Studio 2005 project containing a few dozen c# files. Now I want to automate this build using ant (have not yet looked at nant, but the rest of my...
0
by: james.mcdonagh | last post by:
Hi I am a newbie using nAnt for .net 2.0. As such I have not come across this bug before, and I would be happy of any help that you may be able to provide. In order to help I have included the...
1
by: jamesmcdonagh | last post by:
Hi newbie using nAnt for .net 2.0. I would be happy of any help that you may be able to provide. The weird thing is that VS.net builds without a problem. And the intellisense within the object...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.