Wen Ching Chua wrote:


I try to find on the internet on how to achieve this in C#, 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 which portion of the NAnt code can do this?


I'm not quite sure what you are asking. The above project works fine for me :

Target framework: Microsoft .NET Framework 1.1
Target(s) specified: test

test:

    [echo] Building PropertyTest-1.0.0

BUILD SUCCEEDED

Total time: 0 seconds.


an alternative is to use the project::get-name() function [1] like this:

<target name="test">
        <echo message="Building ${project::get-name()}-${project.version}"/>
</target>

to get the project name.
You'll need to be running 0.85rc1 or a nightly build to use the function.

Ian

[1] http://nant.sourceforge.net/release/latest/help/functions/project.get-name.html


------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ nant-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to