Assembly versioning

20 views
Skip to first unread message

Mikael Henriksson

unread,
Mar 24, 2010, 6:19:25 AM3/24/10
to phantom-discuss
Hey guys,

I need to somehow do the whole version thing for the generated
assemblies. There is a neat task for that in NAnt and I was just
wanting some guidance here. How do I achieve the following using boo
and Phantom?
http://codepaste.net/ftkkbo

I need to read the team city build number variable and then use that
for the assembly version.
<target name="buildnumber">
<if test="${property::exists('build.number')}">
<property name="project.fullversion" value="${build.number}" />
</if>
<asminfo output="${solution.dir}/AssemblyInfo.cs"
language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
</imports>
<attributes>
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="AssemblyTitleAttribute"
value="Company.Project" />
<attribute type="AssemblyDescriptionAttribute" value="Some
silly description" />
<attribute type="AssemblyCompanyAttribute" value="Company
Name" />
<attribute type="AssemblyProductAttribute" value="Company
Name - Product Name" />
<attribute type="AssemblyVersionAttribute" value="$
{project.fullversion}" />
</attributes>
</asminfo>
</target>

Jeremy Skinner

unread,
Mar 24, 2010, 6:22:31 AM3/24/10
to phantom...@googlegroups.com
There's a generate_assembly_info runnable that you should be able to use:

  with generate_assembly_info():
    .file = "TestAssemblyInfo.cs"
    .version = "version goes here"
    .fileVersion = "version goes here"
    .title = "title"
    .description  = "my description"
    .copyright = "copyright"

To unsubscribe from this group, send email to phantom-discuss+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Jeremy Skinner

unread,
Mar 24, 2010, 6:33:20 AM3/24/10
to phantom...@googlegroups.com
Forgot to mention: you can read the teamcity build number by using the env function to read the appropriate environment variable.

Jeremy

Mikael Henriksson

unread,
Mar 24, 2010, 7:16:21 AM3/24/10
to phantom-discuss
Brilliant, I'll add something on the wiki about it when I am done.

On Mar 24, 11:33 am, Jeremy Skinner <jer...@jeremyskinner.co.uk>
wrote:

Reply all
Reply to author
Forward
0 new messages