Skip to content

Version Assemblies and Packages Tasks YAML

rfennell edited this page Jun 13, 2024 · 31 revisions

Manifest Versioning Build Tasks

The 'Manifest Versioning Build Tasks' package contains the following tasks. The table show the possible variables that can be used in YAML Azure DevOps Pipeline configurations

VersionAndroidManifest V3

Applies a version to an Android Manifest via the versionCode property based on the build number.

YAML snippet

# Version Android Manifest
# Description - Applies a version to an Android Manifest via the versionCode property based on the build number.
- task: VersionAndroidManifest@3
  inputs: 
     # Required arguments
     Path: $(Build.SourcesDirectory)
     VersionNumber: $(Build.BuildNumber)
     VersionNameFormat: {1}.{2}
     Injectversioncode: false
     VersionCodeFormat: {3}
     Injectversion: false
     VersionRegex: \d+\.\d+\.\d+
     FilenamePattern: AndroidManifest.xml
     OutputVersion: OutputedVersion

Arguments

  • Argument: Path
    • Description: Source folder for manifest files, can be root as it will find all files recursively
    • Type: string
    • Required: true
    • Default (if defined): $(Build.SourcesDirectory)
  • Argument: VersionNumber
    • Description: Version number to apply to files, can be extraced from the build name 'Build HelloWorld_00.00.00000' format
    • Type: string
    • Required: true
    • Default (if defined): $(Build.BuildNumber)
  • Argument: VersionNameFormat
    • Description: Format of version number to apply as Version Name. Assumes starting from the beginning of the version number.
    • Type: string
    • Required: true
    • Default (if defined): {1}.{2}
  • Argument: Injectversioncode
    • Description: If True use the version code as it directly entered, do not generate it
    • Type: boolean
    • Required: true
    • Default (if defined): false
  • Argument: VersionCodeFormat
    • Description: This is the part(s) of the version number to use for the version code. This will concatenate these parts together to a single integer.
    • Type: string
    • Required: true
    • Default (if defined): {3}
  • Argument: VersionCode
    • Description: An externally generated version code in range 1-2100000000 as required by Google Play Store.
    • Type: string
    • Required: false
    • Default (if defined):

Advanced

  • Argument: Injectversion
    • Description: If True no regex processing will be done to the build number. The build number must format must match the requirements of the 'Version Name Pattern' and 'Version Code Pattern'
    • Type: boolean
    • Required: true
    • Default (if defined): false
  • Argument: VersionRegex
    • Description: Regular expression filter to get build number from the build name.
    • Type: string
    • Required: true
    • Default (if defined): \d+.\d+.\d+
  • Argument: FilenamePattern
    • Description: The filename pattern to update.
    • Type: string
    • Required: true
    • Default (if defined): AndroidManifest.xml

Output

  • Argument: OutputVersion
    • Description: The actual version number extracted and used from the build number.
    • Type: string
    • Required: true
    • Default (if defined): OutputedVersion

VersionAngularFile V3

Applies a version to a named field in a Angular Environment.TS

YAML snippet

# Version Angular Environment.TS File
# Description - Applies a version to a named field in a Angular Environment.TS
- task: VersionAngularFile@3
  inputs: 
     # Required arguments
     Path: $(Build.SourcesDirectory)
     VersionNumber: $(Build.BuildNumber)
     Injectversion: False
     VersionRegex: \d+\.\d+\.\d+\.\d+
     versionForJSONFileFormat: {1}.{2}.{3}.{4}
     FilenamePattern: environment.ts
     OutputVersion: OutputedVersion

Arguments

  • Argument: Path
    • Description: Source folder for assemblies files, can be root as it will find all files recursively
    • Type: string
    • Required: true
    • Default (if defined): $(Build.SourcesDirectory)
  • Argument: VersionNumber
    • Description: Version number to apply to files, can be extraced from the build name 'Build HelloWorld_00.00.00000.0' format
    • Type: string
    • Required: true
    • Default (if defined): $(Build.BuildNumber)

Advanced

  • Argument: Injectversion
    • Description: If True no regex processing will be done to the build number. The build number must format must match the requirements of the 'Version Format for JSON File'
    • Type: boolean
    • Required: true
    • Default (if defined): False
  • Argument: VersionRegex
    • Description: Regular expression filter to get build number from the build name.
    • Type: string
    • Required: true
    • Default (if defined): \d+.\d+.\d+.\d+
  • Argument: versionForJSONFileFormat
    • Description: Format of version number to apply as Version in the Angular Enviroment.TS File.
    • Type: string
    • Required: true
    • Default (if defined): {1}.{2}.{3}.{4}
  • Argument: FilenamePattern
    • Description: The filename pattern to update. Can be in the simple form 'environment.ts' or regex 'environment.(.*).ts'
    • Type: string
    • Required: true
    • Default (if defined): environment.ts
  • Argument: Field
    • Description: The version field to update, if blank all version fields are updated usually "version": "1.1.1"
    • Type: string
    • Required: false
    • Default (if defined): version

Output

  • Argument: OutputVersion
    • Description: The actual version number extracted and used from the build number.
    • Type: string
    • Required: true
    • Default (if defined): OutputedVersion

VersionAPPX V3

Applies a version to a APPX manifest based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview

YAML snippet

# Version APPX manifest
# Description - Applies a version to a APPX manifest based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview
- task: VersionAPPX@3
  inputs: 
     # Required arguments
     Path: $(Build.SourcesDirectory)
     VersionNumber: $(Build.BuildNumber)
     InjectVersion: False
     VersionRegex: (0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){3}
     OutputVersion: OutputedVersion

Arguments

  • Argument: Path
    • Description: Source folder for APPX files, can be root as it will find all files recursively
    • Type: string
    • Required: true
    • Default (if defined): $(Build.SourcesDirectory)
  • Argument: VersionNumber
    • Description: Version number to apply to files, can be extraced from the build name 'Build HelloWorld_00.00.00000.0' format
    • Type: string
    • Required: true
    • Default (if defined): $(Build.BuildNumber)

Advanced

  • Argument: InjectVersion
    • Description: If True no regex processing will be done to the build number.
    • Type: boolean
    • Required: true
    • Default (if defined): False
  • Argument: VersionRegex
    • Description: Regular expression filter build number from name.
    • Type: string
    • Required: true
    • Default (if defined): (0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){3}

Output

  • Argument: OutputVersion
    • Description: The actual version number extracted and used from the build number.
    • Type: string
    • Required: true
    • Default (if defined): OutputedVersion

VersionAssemblies V3

Applies a version to a .NET Framework assembly (4.8 and earlier) via the assemblyinfo.cs or .vb files based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview

YAML snippet

# Version .NET Framework Assemblies
# Description - Applies a version to a .NET Framework assembly (4.8 and earlier) via the assemblyinfo.cs or .vb files based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview
- task: VersionAssemblies@3
  inputs: 
     # Required arguments
     Path: $(Build.SourcesDirectory)
     VersionNumber: $(Build.BuildNumber)
     InjectVersion: False
     FilenamePattern: AssemblyInfo.*
     OutputVersion: OutputedVersion

Arguments

  • Argument: Path
    • Description: Source folder for assemblies files, can be root as it will find all files recursively
    • Type: string
    • Required: true
    • Default (if defined): $(Build.SourcesDirectory)
  • Argument: VersionNumber
    • Description: Version number to apply to files, can be extraced from the build name 'Build HelloWorld_00.00.00000.0' format
    • Type: string
    • Required: true
    • Default (if defined): $(Build.BuildNumber)

Advanced

  • Argument: InjectVersion
    • Description: If True no regex processing will be done to the build number.
    • Type: boolean
    • Required: true
    • Default (if defined): False
  • Argument: VersionRegex
    • Description: Regular expression filter to get build number from the build name.
    • Type: string
    • Required: false
    • Default (if defined): \d+.\d+.\d+.\d+
  • Argument: FilenamePattern
    • Description: The filename pattern to update.
    • Type: string
    • Required: true
    • Default (if defined): AssemblyInfo.*
  • Argument: Field
    • Description: The version field to update, if blank all version fields are updated.
    • Type: string
    • Required: false
    • Default (if defined):

Output

  • Argument: OutputVersion
    • Description: The actual version number extracted and used from the build number.
    • Type: string
    • Required: true
    • Default (if defined): OutputedVersion

VersionDacpac V3

Applies specified version number to all dacpac files in target folder

YAML snippet

# Version DacPacs
# Description - Applies specified version number to all dacpac files in target folder
- task: VersionDacpac@3
  inputs: 
     # Required arguments
     Path: $(Build.SourcesDirectory)
     VersionNumber: $(Build.BuildNumber)
     InjectVersion: False
     VersionRegex: \d+\.\d+\.\d+\.\d+
     OutputVersion: OutputedVersion

Arguments

  • Argument: Path
    • Description: Source folder for dacpac files, can be root as it will find all dacpacs recursively
    • Type: string
    • Required: true
    • Default (if defined): $(Build.SourcesDirectory)
  • Argument: VersionNumber
    • Description: Version number to apply to files, should be in format that matches Regex expression (in advanced settings)
    • Type: string
    • Required: true
    • Default (if defined): $(Build.BuildNumber)

Advanced

  • Argument: ToolPath
    • Description: The path to the folder containing the files Microsoft.SqlServer.Dac.dll and Microsoft.SqlServer.Dac.Extensions.dll. This path will be used in precedence to paths found using the automatic scan path
    • Type: string
    • Required: false
    • Default (if defined):
  • Argument: InjectVersion
    • Description: If True no regex processing will be done to the build number.
    • Type: boolean
    • Required: true
    • Default (if defined): False
  • Argument: VersionRegex
    • Description: Regular expression filter build number from name.
    • Type: string
    • Required: true
    • Default (if defined): \d+.\d+.\d+.\d+
  • Argument: VSVersion
    • Description: A filter for the Visual Studio version to scan for the SQL DAC SDK e.g 2017, 2015, 2022. if not set will scan for all versions and the newest used.
    • Type: string
    • Required: false
    • Default (if defined):
  • Argument: SDKVersion
    • Description: A filter for the SQL DAC SDK e.g 130, 150. if not set will scan for all versions and the newest used.
    • Type: string
    • Required: false
    • Default (if defined):

Output

  • Argument: OutputVersion
    • Description: The actual version number extracted and used from the build number.
    • Type: string
    • Required: true
    • Default (if defined): OutputedVersion

VersionDotNetCoreAssemblies V3

Applies a version to a .NET Assemblies (Core/5/6 and later) via the .csproj files based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview

YAML snippet

# Version .NET Assemblies (Core/5/6 and later)
# Description - Applies a version to a .NET Assemblies (Core/5/6 and later) via the .csproj files based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview
- task: VersionDotNetCoreAssemblies@3
  inputs: 
     # Required arguments
     Path: $(Build.SourcesDirectory)
     VersionNumber: $(Build.BuildNumber)
     Injectversion: False
     VersionRegex: \d+\.\d+\.\d+\.\d+
     FilenamePattern: .csproj
     OutputVersion: OutputedVersion

Arguments

  • Argument: Path
    • Description: Source folder for assemblies files, can be root as it will find all files recursively
    • Type: string
    • Required: true
    • Default (if defined): $(Build.SourcesDirectory)
  • Argument: VersionNumber
    • Description: Version number to apply to files, can be extracted from the build name 'Build HelloWorld_00.00.00000.0' format
    • Type: string
    • Required: true
    • Default (if defined): $(Build.BuildNumber)

Advanced

  • Argument: Injectversion
    • Description: If True no regex processing will be done to the build number. The build number must format must match the requirements of the 'Version Format for JSON File'
    • Type: boolean
    • Required: true
    • Default (if defined): False
  • Argument: VersionRegex
    • Description: Regular expression filter to get build number from the build name.
    • Type: string
    • Required: true
    • Default (if defined): \d+.\d+.\d+.\d+
  • Argument: FilenamePattern
    • Description: The filename pattern to update. Default to .csproj or can be directory.build.props
    • Type: string
    • Required: true
    • Default (if defined): .csproj
  • Argument: SDKNames
    • Description: A comma separated list of SDK namespaces to use to match .csproj file. Ignored if filename pattern is directory.build.props
    • Type: string
    • Required: false
    • Default (if defined): Microsoft.NET.Sdk
  • Argument: ExcludePaths
    • Description: A comma separated list of paths to exclude when matching .csproj file or directory.build.props files e.g. MyProject1, MyProject2
    • Type: string
    • Required: false
    • Default (if defined):
  • Argument: Field
    • Description: The version field to update, if blank all version fields are updated usually 1.1.1.1.
    • Type: string
    • Required: false
    • Default (if defined):
  • Argument: AddDefault
    • Description: Adds the version field if no version field is found, and no other field name specified e.g. 1.1.1.1.
    • Type: boolean
    • Required: false
    • Default (if defined): False
  • Argument: versionFields
    • Description: Default version fields to update if no specific field is specified. Defaults to Version, VersionPrefix, AssemblyVersion.
    • Type: string
    • Required: false
    • Default (if defined): Version, VersionPrefix, AssemblyVersion

Output

  • Argument: OutputVersion
    • Description: The actual version number extracted and used from the build number.
    • Type: string
    • Required: true
    • Default (if defined): OutputedVersion

VersionIOSPlistManifest V3

Applies a version to an iOS Plist Manifest via the CFBundleShortVersionString and CFBundleVersion property based on the build number.

YAML snippet

# Version iOS Plist Manifest
# Description - Applies a version to an iOS Plist Manifest via the CFBundleShortVersionString and CFBundleVersion property based on the build number.
- task: VersionIOSPlistManifest@3
  inputs: 
     # Required arguments
     Path: $(Build.SourcesDirectory)
     VersionNumber: $(Build.BuildNumber)
     VersionNameFormat: {1}.{2}
     Injectversion: false
     CFBundleVersionFormat: {1}.{2}
     CFBundleShortVersionStringFormat: {1}.{2}
     VersionRegex: \d+\.\d+\.\d+
     FilenamePattern: info.plist
     OutputVersion: OutputedVersion

Arguments

  • Argument: Path
    • Description: Source folder for manifest files, can be root as it will find all files recursively
    • Type: string
    • Required: true
    • Default (if defined): $(Build.SourcesDirectory)
  • Argument: VersionNumber
    • Description: Version number to apply to files, can be extracted from the build name 'Build HelloWorld_00.00.00000' format
    • Type: string
    • Required: true
    • Default (if defined): $(Build.BuildNumber)
  • Argument: VersionNameFormat
    • Description: Format of version number to apply as Version Name. Assumes starting from the beginning of the version number.
    • Type: string
    • Required: true
    • Default (if defined): {1}.{2}
  • Argument: Injectversion
    • Description: If True use the injected version without formatting as directly entered for both CFBundleShortVersionString and CFBundleVersion
    • Type: boolean
    • Required: true
    • Default (if defined): false
  • Argument: CFBundleVersionFormat
    • Description: This is the part(s) of the version number to use for the CFBundleVersion.
    • Type: string
    • Required: true
    • Default (if defined): {1}.{2}
  • Argument: CFBundleShortVersionStringFormat
    • Description: This is the part(s) of the version number to use for the CFBundleShortVersionString
    • Type: string
    • Required: true
    • Default (if defined): {1}.{2}
  • Argument: VersionRegex
    • Description: Regular expression filter to get build number from the build name.
    • Type: string
    • Required: true
    • Default (if defined): \d+.\d+.\d+
  • Argument: FilenamePattern
    • Description: The filename pattern to update.
    • Type: string
    • Required: true
    • Default (if defined): info.plist

Advanced

Output

  • Argument: OutputVersion
    • Description: The actual version number extracted and used from the build number.
    • Type: string
    • Required: true
    • Default (if defined): OutputedVersion

VersionJSONFile V3

Applies a version to a named field in a JSON File

YAML snippet

# Version JSON File
# Description - Applies a version to a named field in a JSON File
- task: VersionJSONFile@3
  inputs: 
     # Required arguments
     Path: $(Build.SourcesDirectory)
     recursion: True
     VersionNumber: $(Build.BuildNumber)
     useBuildNumberDirectly: False
     VersionRegex: \d+\.\d+\.\d+\.\d+
     versionForJSONFileFormat: {1}.{2}.{3}
     FilenamePattern: package.json
     OutputVersion: OutputedVersion

Arguments

  • Argument: Path
    • Description: Source folder for assemblies files, can be root as it will find all files recursively
    • Type: string
    • Required: true
    • Default (if defined): $(Build.SourcesDirectory)
  • Argument: recursion
    • Description: If true will search from specfied path for all matching files
    • Type: boolean
    • Required: true
    • Default (if defined): True
  • Argument: VersionNumber
    • Description: Version number to apply to files, can be extraced from the build name 'Build HelloWorld_00.00.00000.0' format
    • Type: string
    • Required: true
    • Default (if defined): $(Build.BuildNumber)

Advanced

  • Argument: useBuildNumberDirectly
    • Description: Use the version number parameter without any further processing
    • Type: boolean
    • Required: true
    • Default (if defined): False
  • Argument: VersionRegex
    • Description: Regular expression filter to get build number from the build name.
    • Type: string
    • Required: true
    • Default (if defined): \d+.\d+.\d+.\d+
  • Argument: versionForJSONFileFormat
    • Description: Format of version number to apply as Version in the JSON File.
    • Type: string
    • Required: true
    • Default (if defined): {1}.{2}.{3}
  • Argument: FilenamePattern
    • Description: The filename pattern to update. Can be in the simple form 'package.json' or regex such as '^package.json'
    • Type: string
    • Required: true
    • Default (if defined): package.json
  • Argument: Field
    • Description: The version field to update, if blank all version fields are updated usually "version": "1.1.1"
    • Type: string
    • Required: false
    • Default (if defined): version

Output

  • Argument: OutputVersion
    • Description: The actual version number extracted and used from the build number.
    • Type: string
    • Required: true
    • Default (if defined): OutputedVersion

VersionNuspec V3

Applies a version to a Nuspec manifest based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview

YAML snippet

# Version Nuspec package
# Description - Applies a version to a Nuspec manifest based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview
- task: VersionNuspec@3
  inputs: 
     # Required arguments
     Path: $(Build.SourcesDirectory)
     Filename: *.nuspec
     VersionNumber: $(Build.BuildNumber)
     InjectVersion: False
     VersionRegex: (0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){3}
     OutputVersion: OutputedVersion

Arguments

  • Argument: Path
    • Description: Source folder for NuSpec files, can be root as it will find all files recursively
    • Type: string
    • Required: true
    • Default (if defined): $(Build.SourcesDirectory)
  • Argument: Filename
    • Description: The fiename pattern to search for recursively
    • Type: string
    • Required: true
    • Default (if defined): *.nuspec
  • Argument: VersionNumber
    • Description: Version number to apply to files, can be extraced from the build name 'Build HelloWorld_00.00.00000.0' or provided as a complete version number e.g. 1.1.1.1
    • Type: string
    • Required: true
    • Default (if defined): $(Build.BuildNumber)

Advanced

  • Argument: InjectVersion
    • Description: If True no regex processing will be done to the build number.
    • Type: boolean
    • Required: true
    • Default (if defined): False
  • Argument: VersionRegex
    • Description: Regular expression filter build number from name.
    • Type: string
    • Required: true
    • Default (if defined): (0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){3}

Output

  • Argument: OutputVersion
    • Description: The actual version number extracted and used from the build number.
    • Type: string
    • Required: true
    • Default (if defined): OutputedVersion

VersionPowerShellModule V3

Applies specified version number to one or more PowerShell modules in a target folder.

YAML snippet

# Version PowerShell Module
# Description - Applies specified version number to one or more PowerShell modules in a target folder.
- task: VersionPowerShellModule@3
  inputs: 
     # Required arguments
     Path: $(Build.SourcesDirectory)
     VersionNumber: $(Build.BuildNumber)
     InjectVersion: False
     VersionRegex: \d+\.\d+\.\d+\.\d+
     OutputVersion: OutputedVersion

Arguments

  • Argument: Path
    • Description: Source folder for PowerShell module files, can be root as it will find all module psd1 files recursively
    • Type: string
    • Required: true
    • Default (if defined): $(Build.SourcesDirectory)
  • Argument: VersionNumber
    • Description: Version number to apply to files
    • Type: string
    • Required: true
    • Default (if defined): $(Build.BuildNumber)

Advanced

  • Argument: InjectVersion
    • Description: If True no regex processing will be done to the build number.
    • Type: boolean
    • Required: true
    • Default (if defined): False
  • Argument: VersionRegex
    • Description: Regular expression filter build number from name.
    • Type: string
    • Required: true
    • Default (if defined): \d+.\d+.\d+.\d+

Output

  • Argument: OutputVersion
    • Description: The actual version number extracted and used from the build number.
    • Type: string
    • Required: true
    • Default (if defined): OutputedVersion

VersionSharepointAppManifest V3

Applies a version to a SharepointAppManifest based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview

YAML snippet

# Version Sharepoint App Manifest
# Description - Applies a version to a SharepointAppManifest based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview
- task: VersionSharepointAppManifest@3
  inputs: 
     # Required arguments
     Path: $(Build.SourcesDirectory)
     VersionNumber: $(Build.BuildNumber)
     InjectVersion: False
     VersionRegex: (0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){3}
     OutputVersion: OutputedVersion

Arguments

  • Argument: Path
    • Description: Source folder for SharepointAppManifest files, can be root as it will find all files recursively
    • Type: string
    • Required: true
    • Default (if defined): $(Build.SourcesDirectory)
  • Argument: VersionNumber
    • Description: Version number to apply to files, can be extraced from the build name 'Build HelloWorld_00.00.00000.0' format
    • Type: string
    • Required: true
    • Default (if defined): $(Build.BuildNumber)

Advanced

  • Argument: InjectVersion
    • Description: If True no regex processing will be done to the build number.
    • Type: boolean
    • Required: true
    • Default (if defined): False
  • Argument: VersionRegex
    • Description: Regular expression filter build number from name.
    • Type: string
    • Required: true
    • Default (if defined): (0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){3}

Output

  • Argument: OutputVersion
    • Description: The actual version number extracted and used from the build number.
    • Type: string
    • Required: true
    • Default (if defined): OutputedVersion

VersionVSIX V3

Applies a version to a VSIX manifest based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview

YAML snippet

# Version VSIX package
# Description - Applies a version to a VSIX manifest based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview
- task: VersionVSIX@3
  inputs: 
     # Required arguments
     Path: $(Build.SourcesDirectory)
     VersionNumber: $(Build.BuildNumber)
     UseRegex: true
     DigitMode: All
     VersionRegex: \d+\.\d+\.\d+\.\d+
     OutputVersion: OutputedVersion

Arguments

  • Argument: Path
    • Description: Source folder for VSIX files, can be root as it will find all files recursively
    • Type: string
    • Required: true
    • Default (if defined): $(Build.SourcesDirectory)
  • Argument: VersionNumber
    • Description: Version number to apply to files, can be extraced from the build name 'Build HelloWorld_00.00.00000.0' or provided as a complete version number e.g. 1.1.1.1
    • Type: string
    • Required: true
    • Default (if defined): $(Build.BuildNumber)
  • Argument: UseRegex
    • Description: If set a regex expression is used to extra the version number, in the form 1.1.1.1 from a build number. (For legacy reason inverse of 'Inject Version' on other tasks in family
    • Type: boolean
    • Required: true
    • Default (if defined): true
  • Argument: DigitMode
    • Description: Select how many digits of the discovered version number to use.
    • Type: pickList
    • Required: true
    • Default (if defined): All
  • Argument: VersionRegex
    • Description: Regular expression filter build number from name.
    • Type: string
    • Required: true
    • Default (if defined): \d+.\d+.\d+.\d+

Output

  • Argument: OutputVersion
    • Description: The actual version number extracted and used from the build number.
    • Type: string
    • Required: true
    • Default (if defined): OutputedVersion

VersionWix V3

Applies a version to a Wix manifest based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview

YAML snippet

# Version Wix manifest
# Description - Applies a version to a Wix manifest based on the build number. Based on Microsoft sample from https://msdn.microsoft.com/Library/vs/alm/Build/overview
- task: VersionWix@3
  inputs: 
     # Required arguments
     Path: $(Build.SourcesDirectory)
     File: InstallerVersion.wxi
     VersionNumber: $(Build.BuildNumber)
     InjectVersion: False
     VersionRegex: (0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){3}
     FieldsToMatch: MajorVersion,MinorVersion,BuildNumber,Revision,FullVersion
     OutputVersion: OutputedVersion

Arguments

  • Argument: Path
    • Description: Source folder for Wix files, can be root as it will find all files recursively
    • Type: string
    • Required: true
    • Default (if defined): $(Build.SourcesDirectory)
  • Argument: File
    • Description: The name of include file contaong the version
    • Type: string
    • Required: true
    • Default (if defined): InstallerVersion.wxi
  • Argument: VersionNumber
    • Description: Version number to apply to files, can be extraced from the build name 'Build HelloWorld_00.00.00000.0' format
    • Type: string
    • Required: true
    • Default (if defined): $(Build.BuildNumber)

Advanced

  • Argument: InjectVersion
    • Description: If True no regex processing will be done to the build number.
    • Type: boolean
    • Required: true
    • Default (if defined): False
  • Argument: VersionRegex
    • Description: Regular expression filter build number from name.
    • Type: string
    • Required: true
    • Default (if defined): (0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){3}
  • Argument: FieldsToMatch
    • Description: The list of five field names that will be updated in the wxi file.
    • Type: string
    • Required: true
    • Default (if defined): MajorVersion,MinorVersion,BuildNumber,Revision,FullVersion

Output

  • Argument: OutputVersion
    • Description: The actual version number extracted and used from the build number.
    • Type: string
    • Required: true
    • Default (if defined): OutputedVersion
Clone this wiki locally