Skip to content

Commit

Permalink
deploy script added
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Solnica committed Oct 21, 2016
1 parent 7171c4d commit 68f2679
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions scripts/Update-AssemblyInfoVersionFiles.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
function Update-AssemblyInfoVersionFiles ([string]$versionIdentifier)
{
$local:srcPath = $env:BUILD_SOURCESDIRECTORY
$local:buildNumber = $env:BUILD_BUILDNUMBER

Write-Host "Executing Update-AssemblyInfoVersionFiles in path $srcPath for build $buildNumber"

foreach ($file in $(Get-ChildItem $srcPath AssemblyInfo.cs -recurse))
{
$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($_, "$versionIdentifier(""`$1.$buildNumber"")")
Write-Host "Change version to $s"
$s
} else {
$_
}
} | Set-Content -Encoding utf8 $file.FullName -Force
}
}

Update-AssemblyInfoVersionFiles "AssemblyFileVersion" -Verbose
Update-AssemblyInfoVersionFiles "AssemblyVersion" -Verbose

0 comments on commit 68f2679

Please sign in to comment.