From 72084e5aef802ffd7e81969562753dd18498b3e6 Mon Sep 17 00:00:00 2001 From: Adam Hellberg Date: Sun, 6 Sep 2015 15:37:56 +0200 Subject: [PATCH] Fix version script --- Corale.Colore/Properties/AssemblyInfo.cs | Bin 3684 -> 6982 bytes set_tc_version.ps1 => set_version.ps1 | 29 +++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) rename set_tc_version.ps1 => set_version.ps1 (53%) diff --git a/Corale.Colore/Properties/AssemblyInfo.cs b/Corale.Colore/Properties/AssemblyInfo.cs index bdea3555ddcf288b03f50c7450256beb06733144..be5e80ffe21608fa9bbcf9d4dc77b3d1a4286642 100644 GIT binary patch literal 6982 zcmdU!+fG|o5Qf)vrM|-!xhSa;lT#DYrj-b%pnySOl15c8jIo28fGr==(l_c$w*9{u z5Bp>YR86bMGTwWwwP*f0teJmp{`zw%Eu}2o{j5G;rZ0pV+|N=c4bm{3r%~#sx9KEJ zG}_bk`_xU}r-ihV#`<*AX*$x_dD=>6njfTwo*ZjFGYO}X(bmklJ+rF$k?xVPkbX$H zzD(=+u%fE<4~;)a_tO3JjjoO)E0gwP$vM^43(0z~&yjvdLYkSrWBooiU1wT35P~cn z7@~)P>V z=9x~K%8y;GL-$1U?yZP5RxfHC%QHpoprT_T-7Z*mtX0G}GYjTpMNU;pCd_@)G7uhe z4KI&%MgDd4>$vbSzUfHERQSVB)u-QUh6t8z3M=xQ#yVnBM>>^uk6G*lbf0Q1T6>Cz z-+R{i%Aqi^8;Hh<&9gSFI5Nw8<@jP{M_SG-ke$~;ErC@R&{34r(Z#)y) zs3q7wu*~q?KqSa#;_CS@PTv+{SJ%~=q2&rcGE^`rPr#k`!=$ru`KQBZa2MBm0#27nnvgV%rL)T@qDdoh`{bq9LNy@P*2-_+WsWbE7TrshF}Hyc{PoUg-wuVypE5WL&^ zgq3wqu9%OA)&7OQ>At%{^2YRSN($a%&9=OYC$Q+buH2`1W83a>D?PGAWJUOPEJka( z-q9EQ5nCec5!f$CyV|#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2FP||jws2B(9xH?m=9qI-) zZTXl5J*;(cV9TeF)uu#bR0(O^=njLJICs+%Y*;O$)TI>{=kFm2B$?BB~@j>QI|(iIcBawnDQg9Mnb|M}QmV zary`S7GL?am|es-UgT4-pm{X=6ioaH^}Pi?_lI;7#8?iY0JN8>95 z@Xmv25Z?|vyo(?XIl{#(B9G=?6bIww)Qf1ojOMe24>A*=he3D|A((&dhw%u(@r?XW z_&|#*Z#w0O9i+EJN)eN$@oat@1(#PbUCpKw9}mxc@bu27eiIRyj;CI5J*0_u?Oih0 zh-LtboY^7Qn=9YFL39uQ#&IwUIk)jFj3ay;BK0WVA>0HDe@I>wEVxP+(F{?z)bK!% zAnf?UJ@gweJ`GpA-J!vfi@8K4cFZQeHw7e4Fg!3mIQogQNiGz|>mziFb*vkqvCcJQ z0*!Ca{o_*7fW9MjkmB(b1GKtLdrsWLp4c%?9h{C6jo9b&^D zv!*ssS&>`1SHjH+5O`#oA{K7%0if5*|dzUgS0U2ol@e2o6i_IWXFz+st+6BSIs*KkoH@?g)M)ucaERDwhM?;oR;0 z7yo?9W+H8Z7U7Bx`W}s+9gjjkrd+LzFirC*u9ZO1+iR|AhUXUf7+nZjOnw}F1)Wa= zy~`Zj9`Q7XxzTBzRR4qNxNA4I>-Lv#*h0QSG49%Y&}WOsHF8Z-Vst(!Ok*x%-6euH z0QECbfLJyRJ?{PX2ykN>&}!qc}0SlyY7b(yKV+PLl-^e1vv-_hW=)3+}g7@0Tj zZ(e_k``PKv-OB&lv5g1;$$HOZ4$p7m9?4t^bn;(jzX$kc{;lg_1}+gEin*(f+`O8iR*M_ki2VZKMdy6an{N;1xOLnavN^H5G diff --git a/set_tc_version.ps1 b/set_version.ps1 similarity index 53% rename from set_tc_version.ps1 rename to set_version.ps1 index 4ee006ec..dbad1421 100644 --- a/set_tc_version.ps1 +++ b/set_version.ps1 @@ -1,9 +1,15 @@ -$buildCounter = "$env:build_counter" -$branch = "$env:teamcity_build_branch" +[CmdletBinding()] +Param( + [Parameter(Mandatory=$True, Position=1)] + [int]$buildCounter, + + [Parameter(Mandatory=$True, Position=2)] + [string]$branch +) $prefix = 'refs/heads/' $tagPrefix = 'refs/tags/' -$isTag = False +$isTag = $False $friendlyVersion = '0.0.0' $buildNumber = "${friendlyVersion}.${buildCounter}" @@ -15,7 +21,7 @@ if ($branch.StartsWith($prefix)) elseif ($branch.StartsWith($tagPrefix)) { $branch = $branch.substring($tagPrefix.length) - $isTag = True + $isTag = $True } Write-Host "Build counter: $buildCounter" @@ -37,10 +43,19 @@ elseif ($branch -match "^v\d+\.\d+\.\d+$") $buildNumber = "${friendlyVersion}.${buildCounter}" } -Write-Host "##teamcity[buildNumber '$buildNumber']" -Write-Host "##teamcity[setParameter name='Version' value='$friendlyVersion']" +$infoVersion = $friendlyVersion if (!$isTag) { - Write-Host "##teamcity[setParameter name='InfoVersion' value='$friendlyVersion-$branch']" + $infoVersion = "${friendlyVersion}-${branch}" } + +Write-Host "##teamcity[buildNumber '$buildNumber']" +Write-Host "##teamcity[setParameter name='Version' value='$friendlyVersion']" +Write-Host "##teamcity[setParameter name='InfoVersion' value='$infoVersion']" + +(Get-Content Corale.Colore/Properties/AssemblyInfo.cs) ` + -replace '^\[assembly: AssemblyVersion.+$', "[assembly: AssemblyVersion(`"$friendlyVersion`")]" ` + -replace '^\[assembly: AssemblyFileVersion.+$', "[assembly: AssemblyFileVersion(`"$buildNumber`")]" ` + -replace '^\[assembly: AssemblyInformationalVersion.+$', "[assembly: AssemblyInformationalVersion(`"$infoVersion`")]" | +Out-File Corale.Colore/Properties/AssemblyInfo.cs