diff --git a/scripts/Update-AssemblyInfoVersionFiles.ps1 b/scripts/Update-AssemblyInfoVersionFiles.ps1 index 359d55e..4c2384b 100644 --- a/scripts/Update-AssemblyInfoVersionFiles.ps1 +++ b/scripts/Update-AssemblyInfoVersionFiles.ps1 @@ -1,4 +1,4 @@ -function Update-AssemblyInfoVersionFiles +function Update-AssemblyInfoVersionFiles ([string]$versionIdentifier) { $local:srcPath = $env:BUILD_SOURCESDIRECTORY $local:buildNumber = $env:BUILD_BUILDNUMBER @@ -7,14 +7,14 @@ function Update-AssemblyInfoVersionFiles foreach ($file in $(Get-ChildItem $srcPath AssemblyInfo.cs -recurse)) { - $local:r = [regex]"AssemblyFileVersion\(""([0-9]+\.[0-9]+)(\.([0-9]+|\*))+""\)" + $local:r = [regex]"$versionIdentifier\(""([0-9]+\.[0-9]+)(\.([0-9]+|\*))+""\)" $local:assemblyVersion = "0.0.0.0" #version replacements (Get-Content -Encoding utf8 $file.FullName) | % { $m = $r.Matches($_) if ($m -and $m.Success) { $assemblyVersion = "$($m.Groups[1].Value).$buildNumber" - $local:s = $r.Replace($_, "AssemblyFileVersion(""`$1.$buildNumber"")") + $local:s = $r.Replace($_, "$versionIdentifier(""`$1.$buildNumber"")") Write-Host "Change version to $s" $s } else { @@ -24,4 +24,5 @@ function Update-AssemblyInfoVersionFiles } } -Update-AssemblyInfoVersionFiles -Verbose +Update-AssemblyInfoVersionFiles "AssemblyFileVersion" -Verbose +Update-AssemblyInfoVersionFiles "AssemblyVersion" -Verbose