tags:

views:

20

answers:

1

What will be the NAnt equivalent of the below script? This script is in Ant.

<target name="getVersion">
    <propertyfile file="./version.properties">
        <entry key="version" type="string" value="${buildVersion}"/>
    </propertyfile>
</target>
A: 

Use the <include> task. The documentation is here. The contents of the include file should be in the form of xml not value pairs as in java. For example

<?xml version="1.0"?>
<project name="Project Properties" default="">
  <property name="dotnet-version" value="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\"/>  
  <property name="output-dir" value="c:\working\testproj\out"/>
  <property name="temp-dir" value="C:\temp"/>
</project>
Pram