In this example a confige file is written.

<target name="Private.Coverage.WriteConfiguration">
    <call target="Private.Coverage.GetConfigFile"/>
    
    <write file="${Private.Coverage.ConfigFile}" append="false">
      <text><![CDATA[<?xml version="1.0"?>
<CoverageConfiguration targetNamespace="urn:CoverageConfiguration">]]>
</text>
    </write>
    
    <foreach item="File" property="Private.Coverage.PrepareFor.AssemblyPath" >
      <in>
        <items refid="Coverage.Targets" />
      </in>
      <do>
        <write file="${Private.Coverage.ConfigFile}" append="true">
          <text>
            <![CDATA[<Assembly Owner="bogas@nowhere.com" Description="%Description%" AssemblyName="%AssemblyName%" ReportDirectory="%ReportDirectory%"/>]]>
        </text>
        <filterchain>
          <replacestring from="%Description%" to="${path::get-file-name-without-extension(Private.Coverage.PrepareFor.AssemblyPath)}" />
          <replacestring from="%AssemblyName%" to="${string::to-lower(path::get-file-name(Private.Coverage.PrepareFor.AssemblyPath))}" />
          <replacestring from="%ReportDirectory%" to="${Coverage.ReportFolder}" />
          </filterchain>
        </write>
      </do>
    </foreach>
 
    <write file="${Private.Coverage.ConfigFile}" append="true">
      <text><![CDATA[        <Asp Selected="false"/>
        <Services>
        </Services>
</CoverageConfiguration>]]>
</text>
    </write>
</target>
 
nant.write.txt · Last modified: 2006/04/11 09:09 by jflowers
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki