How to use TeamCity AssemblyInfo Patcher assembly function, but exception from external patches of SVN Externals?

I have a project setup in Subversion that has several Subversion Externals. These external substrates refer to other projects.

Subversion Layout Example:

  • repo / Project1 / trunk
  • repo / Project2 / trunk

Ordering example:

  • $ WorkingDir \ Project1 \ Trunk
  • $ WorkingDir \ Project1 \ trunk \ Lib \ Project2

TeamCity allows you to attach the assembly function of the collector AssemblyInfo to your assembly configuration, but does not seem to allow you to exclude external ones. Since Externals are separate projects, I want to keep their assembly version or AssemblyInfo patch them with another template.

At the moment, since my build configuration checks Project1 with full Subversion Externals support and then uses AssemblyInfo Patcher, my Project1 builds and my Project2 builds have the same build version, even if I want them to be different.

Is there a way for Project1 assemblies to be versioned differently with Project2 assemblies?

+4
source share
3 answers

It is currently not possible to provide directories for exclusion.

According to TeamCity documents , AssemblyInfo Patcher updates the values ​​of AssemblyVersion and AssemblyFileVersion in all found AssemblyInfo source files (e.g. AssemblyInfo.cs, AssemblyInfo.vb) before it is built, it will not change the version of existing compiled binary files.

Are the external links that you mention just executables or are you including all Project2 (e.g. binaries, project files, source code, etc.)? You should just include the binaries.

If AssemblyInfo Patcher does not meet your requirements, you will have to go back to doing this manually (for example, using a separate MSBuild script) and excluding the external directory when searching for updated AssemblyInfo files.

+4
source

Starting with TeamCity 9.1, there is a new File Content Replacer feature. This allows you to specify a template to match the files for which you want to replace the text.

JetBrains recommends using this instead of AssemblyInfo Patcher "To replace a wider range of values ​​in more files"

+2
source

I found a super simple solution - just rename the AssemblyInfo.cs file to something like

AssemblyInfoDontChange.cs

-2
source

Source: https://habr.com/ru/post/1400269/


All Articles