Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the TeamCity AssemblyInfo Patcher build feature, but exlude SVN Externals from also being patched?

I have a project setup in Subversion which has a few Subversion Externals defined. These Subversion Externals reference other projects.

Example Subversion layout:

  1. repo/Project1/trunk
  2. repo/Project2/trunk

Example Checkout layout:

  1. $WorkingDir\Project1\trunk
  2. $WorkingDir\Project1\trunk\Lib\Project2

TeamCity allows you to attach a AssemblyInfo Patcher build feature to your build configuration, but does not seem to allow excluding Externals. Since the Externals are separate projects I want to retain their assembly version or AssemblyInfo patch them with a different pattern.

At the moment, because my build configuration checks out Project1 with full Subversion Externals support and then applies the AssemblyInfo Patcher my Project1 assemblies and my Project2 assemblies all have the same assembly version - even though I want them to be different.

Is there a way to have Project1 assemblies versioned differently to the Project2 assemblies?

like image 683
Llyle Avatar asked Feb 22 '23 05:02

Llyle


1 Answers

There currently is no way to provide directories to exclude.

According to the TeamCity docs, the AssemblyInfo Patcher only updates the AssemblyVersion and AssemblyFileVersion values in all found AssemblyInfo source files (e.g. AssemblyInfo.cs, AssemblyInfo.vb) before anything is built, it does not alter the version of existing compiled binaries.

The externals you mention, are they just binaries, or are you including everything of Project2 (e.g binaries, project files, source code etc)? You should just be including the binaries.

If the AssemblyInfo Patcher does not meet your requirements you will have to revert to doing it manually (such as using a seperate MSBuild script) and excluding the external directory when searching for the AssemblyInfo files to update.

like image 198
Siy Williams Avatar answered Apr 08 '23 14:04

Siy Williams