Friday, January 12

NAnt version

I've been trying to add version numbers to a NAnt build script using the <version> task, and come across a problem with the script in Marc Holmes' "Expert .NET delivery" book.

The task increments a property called "buildnumber.version", not "sys.version". Adding the following line to the script (as described here) seems to fix it.

<property name="sys.version" value="${buildnumber.version}" />

3 comments:

Anonymous said...

No need to add the property, all you need to do is to put: property name="sys.version" value="0.0.0.0" before the version-tag.

Anonymous said...

I've just had this same problem with the same book.

However, I believe the problem is that neither "sys.version" nor "buildnumber.version" properties are pre-built into NAnt, and that NAnt-Contrib's "version" task sets a hardcoded and otherwise-unknown "buildnumber.version" property. Excellent lack of doco there, guys!

The easiest solution is to just use "buildnumber" instead of "sys" directly, with the assignment to "0.0.0.0" immediately before the "version" task ie. property name="buildnumber.version" value="0.0.0.0".

Anonymous said...

I've just had this same problem with the same book.

However, I believe the problem is that neither "sys.version" nor "buildnumber.version" properties are pre-built into NAnt, and that NAnt-Contrib's "version" task sets a hardcoded and otherwise-unknown "buildnumber.version" property. Excellent lack of doco there, guys!

The easiest solution is to just use "buildnumber" instead of "sys" directly, with the assignment to "0.0.0.0" immediately before the "version" task ie. property name="buildnumber.version" value="0.0.0.0".