Files
Torch/Versioning/version.ps1
Westin Miller 72b6d0e7bb Tweaks to versioning scheme
Nuke staging
2017-12-02 12:14:48 -08:00

17 lines
685 B
PowerShell

$buildSalt = $Env:BUILD_NUMBER
$gitVersion = git describe --tags
$gitSimpleVersion = git describe --tags --abbrev=0
$simpleVersionStandard = echo $gitSimpleVersion | Select-String -Pattern "([0-9]+)\.([0-9]+)\.([0-9]+)" | % {$_.Matches} | %{$_.Groups[1].Value+"."+$_.Groups[2].Value+"."+$_.Groups[3].Value}
$dotNetVersion = "$simpleVersionStandard.$buildSalt"
$infoVersion = "$gitVersion" -replace "([0-9]+)\.([0-9]+)\.([0-9]+)","$dotNetVersion"
$fileContent = @"
using System.Reflection;
[assembly: AssemblyVersion("$dotNetVersion")]
[assembly: AssemblyInformationalVersion("$infoVersion")]
"@
echo $fileContent | Set-Content "$PSScriptRoot/AssemblyVersion.cs"
echo "$infoVersion"