views:

36

answers:

1

I am using the asminfo task in NAnt but would like to be able to include an explanatory comment in the generated file (to tell the uninitiated that the file was generated by NAnt, and what its purpose is).

Is this possible?

A: 

I'm not aware of any NAnt function to achieve this directly.

What you could do is this: Generate AssemblyInfo file, load its content to a property, overwrite the file with your header, and append the original content.

<asminfo output="${assemblyinfo.path}" language="CSharp">
  <!-- ... -->
</asminfo>
<loadfile
  file="${assemblyinfo.path}"
  property="assemblyinfo.content" />
<echo
  file="${assemblyinfo.path}"
  append="false">
  <![CDATA[//------------------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="ACME INC.">
//   Copyright (c) ACME INC.
// </copyright>
// <summary>
//   The assembly info.
// </summary>
//------------------------------------------------------------------------------

]]>
</echo>
<echo
  file="${assemblyinfo.path}"
  message="${assemblyinfo.content}"
  append="true" />
The Chairman