I am currently “automating the assembly” of our .NET solution (which contains many projects, at least 20. Some winForms, some web projects, all with different release configurations ... ugh!). I am using CruiseControl.NET (or CC.NET, whatevs) and nANT. In addition, DOS and Powershell and several other magic beans we do not need to go into :)
My goal is to create a build shortcut (in which I already have a half-working battle). The build label consists of the Min / Maj number and the SVN check number. This is good for us, and we are pleased with it. Now I need my .NET projects to reference the build number so that my QA members know what build number they are testing.
My version, denoting the nANT task, is as follows:
<project name="updateassemblyversion" default="updateassemblyversion">
<target name="updateassemblyversion" description="generates the version number">
<echo message="Setting the build version to ${CCNetLabel}..." />
<attrib file="AssemblyInfo.cs" readonly="false" />
<asminfo output="AssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
</imports>
<attributes>
<attribute type="AssemblyVersionAttribute" value="${CCNetLabel}" />
<attribute type="AssemblyFileVersionAttribute" value="${CCNetLabel}" />
</attributes>
</asminfo>
<attrib file="AssemblyInfo.cs" readonly="true" />
</target>
In any case, I am trying to install the assembly on my build server. I read that it is not best practice to have 20+ AssemblyInfo.cs files for recording, so I manually created the GlobalyAssemblyInfo.cs file as a “solution item” that is associated with all my projects using “Add ... Existing item. .. Add a link. " I don't think this is what I need, though, since my version control will happen on the build server ...
, NANT ( ), , , , . AssemblyInfo.cs, versionstamps - . , , , , , , , "" script , . , , ? (. № 4).
:
- 20 + AssemblyInfo.cs?
? ,
. , ,
Solution,
, ?
- GlobalAssemblyInfo.cs,
nANT,
, versionstamp it
?
- GlobalAssemblyInfo (
),
,
? ,
,
.
AssemblyXYZ.cs( nANT)
.
?
- # 3 , CC.NET
( NANT?). ,
, VS
GlobalAssemblyInfo.cs( nANT) 20+.NET
?
- .NET ()
/versionstamp? , QA
.
, :)
!