Configuration.VersionFormatString

Hi,

as discussed here $Build.Version$ i propose to add a configuration variable:

$Configuration.VersionFormatString$

Simply providing the value of what’s there already will satisfy the request as dicussed in the above link. I will then be able to use the value in a tag repository event.

Thomas

Hi Thomas,

Can you give more details on how you will use this? The current Version Format String allows expressions. By default this is 1.0.0.$Build.BuildNumber$. We’re not sure how this unexpanded expression will be useful. Are you planning to expand it yourself?

Hi Dave,

specifically i want to use it for:

“Build Event Handler” / “Tag Repository Changeset” / “Tag Name”

The field supports expressions already.

Thomas

Sorry, but I still don’t get why you would want to use the Version Format String rather than $Build.Version$? $Build.Version$ is just Version Format String expanded.

As written in the other post, our FinalBuilder-Script does manipulate CI’s Version by an “Set CI Version” action. For that reason the original value is no longer available.

OK, so why not just use a Set Variable action to store the build version a the start of the build. Adding an expression $Configuration.VersionFormatString$ would not work as its value would not be expanded when used.

Why is that? The “Tag Name” field does support expanding expressions.

$Configuration.VersionFormatString$ would expand to 1.0.0.$Build.BuildNumber$

Ok, i got it.

Is there any other way to retrieve the original value that got expanded at the beginning of the build.

For example:

  • Version Format String: 1.0.0.$Build.Buildnumber$ gets expanded to 1.0.0.35 by Continua
  • FinalBuilder will update CI’s version to “1.0 Build 35”

After executing the Finalbuilder script how can i retrieve the value of “1.0.0.35”?

Add a variable called OriginalBuildVersion for example. Add a Set Variable action before the FinalBuilder action, select OriginalBuildVersion for the Variable and enter $Build.Version$ as the New Value. Tick the Expand variable references in new value checkbox.

Use %OriginalBuildVersion% in your Tag Repository Changeset build event handler

That’s what i use for several configurations already. I was out for a solution that would remove the need to create and assign the variable. It’s not a big deal, but requires extra steps for each configuration that we’re using.

Nevertheless, thank you. I’ll stick with that.

Thomas