Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>CruiseControl.Net 1.4.4 has now an <a href="http://confluence.public.thoughtworks.org/display/CCNET/Assembly+Version+Labeller" rel="noreferrer">Assembly Version Labeller</a>, which generates version numbers compatible with .Net assembly properties.</p> <p>In my project I have it configured as:</p> <pre><code>&lt;labeller type="assemblyVersionLabeller" incrementOnFailure="true" major="1" minor="2"/&gt; </code></pre> <p>(Caveat: <code>assemblyVersionLabeller</code> won't start generating svn revision based labels until an actual commit-triggered build occurs.)</p> <p>and then consume this from my MSBuild projects with <a href="http://msbuildtasks.tigris.org/" rel="noreferrer">MSBuildCommunityTasks.AssemblyInfo</a> :</p> <pre><code>&lt;Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/&gt; &lt;Target Name="BeforeBuild"&gt; &lt;AssemblyInfo Condition="'$(CCNetLabel)' != ''" CodeLanguage="CS" OutputFile="Properties\AssemblyInfo.cs" AssemblyTitle="MyTitle" AssemblyCompany="MyCompany" AssemblyProduct="MyProduct" AssemblyCopyright="Copyright © 2009" ComVisible="false" Guid="some-random-guid" AssemblyVersion="$(CCNetLabel)" AssemblyFileVersion="$(CCNetLabel)"/&gt; &lt;/Target&gt; </code></pre> <p>For sake of completness, it's just as easy for projects using NAnt instead of MSBuild:</p> <pre><code>&lt;target name="setversion" description="Sets the version number to CruiseControl.Net label."&gt; &lt;script language="C#"&gt; &lt;references&gt; &lt;include name="System.dll" /&gt; &lt;/references&gt; &lt;imports&gt; &lt;import namespace="System.Text.RegularExpressions" /&gt; &lt;/imports&gt; &lt;code&gt;&lt;![CDATA[ [TaskName("setversion-task")] public class SetVersionTask : Task { protected override void ExecuteTask() { StreamReader reader = new StreamReader(Project.Properties["filename"]); string contents = reader.ReadToEnd(); reader.Close(); string replacement = "[assembly: AssemblyVersion(\"" + Project.Properties["CCNetLabel"] + "\")]"; string newText = Regex.Replace(contents, @"\[assembly: AssemblyVersion\("".*""\)\]", replacement); StreamWriter writer = new StreamWriter(Project.Properties["filename"], false); writer.Write(newText); writer.Close(); } } ]]&gt; &lt;/code&gt; &lt;/script&gt; &lt;foreach item="File" property="filename"&gt; &lt;in&gt; &lt;items basedir=".."&gt; &lt;include name="**\AssemblyInfo.cs"&gt;&lt;/include&gt; &lt;/items&gt; &lt;/in&gt; &lt;do&gt; &lt;setversion-task /&gt; &lt;/do&gt; &lt;/foreach&gt; &lt;/target&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload