2010-08-07 111 views

回答

2

我不知道任何NAnt函數直接實現這一點。

你可以做的是這樣的:生成AssemblyInfo文件,將其內容加載到屬性,用你的頭覆蓋文件,並附加原始內容。

<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" />