Jeroen
Jeroen

Reputation: 63870

Mix existing and AssemblyInfo patcher generated version info in TeamCity builds

I've enabled a "Build Feature" called "AssemblyInfo patcher" to tweak the version of DLLs generated by my TeamCity builds. I've remixed info from this other question and came up with this Assembly version format setting:

1.0.%build.vcs.number%.%system.build.number%

Now the final thing I would like to achieve is have the Major (1) and Minor (0) come from the original files, instead of hard coding them into TeamCity.

How can I do that?

I've guessed / tried:

{1}.{0}.%build.vcs.number%.%system.build.number%

But this gives an error. I've tried:

%build.vcs.number%.%system.build.number%

But this generates the vcs.number and build.number as major/minor instead of build and revision number, so e.g. 1234.21.0.0.

I've read the AssemblyInfo patcher documentation but it doesn't explain much at all.

I've skimmed the available variables (with the icon to the right of the input field) but found no relevant variables.

How can I set up the "AssemblyInfo patcher" so that:

If it's possible at all?

Upvotes: 2

Views: 1106

Answers (1)

Alina Mishina
Alina Mishina

Reputation: 3380

You can use File Content Replacer. It provides the ability to reference capturing groups of the regular expression and change only specific parts of AssemblyVersion attribute.

Upvotes: 5

Related Questions