Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. "--STEP Updating assembly info"
  2. function Update-SourceVersion
  3. {
  4.   Param ([string]$Revision)
  5.    
  6.   foreach ($o in $input)
  7.   {
  8.     Write-Host "Updating $o"
  9.     $TmpFile  = $TmpFile + ".tmp"
  10.      get-content $o.FullName |        
  11.         %{$_ -replace '(AssemblyVersion|AssemblyFileVersionAttribute|AssemblyFileVersion)\("([0-9]+\.[0-9]+\.[0-9]+)(\.[\*0-9]+)?"\)', ( '$1("$2.' + $Revision + '")' ) }  > $TmpFile
  12.  
  13.     Move-Item $TmpFile $o.FullName -force
  14.   }
  15. }
  16.  
  17. function Update-AllAssemblyInfoFiles ( $ProjectFolder, $version )
  18. {
  19.     Write-Host "Updating assembly info in:`n`t$ProjectFolder"
  20.     # the pipe ? is "pipe - foreach "...
  21.     Get-ChildItem $ProjectFolder -recurse -Include "AssemblyInfo.vb", "AssemblyInfo.cs" |  Update-SourceVersion $version
  22. }
  23.  
  24. Update-AllAssemblyInfoFiles "$ENV:WORKSPACE\tmp" $ENV:SVN_REVISION
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement