Skip to content

Commit

Permalink
Fixing the vsix version. (microsoft#1276)
Browse files Browse the repository at this point in the history
  • Loading branch information
singhsarab authored and harshjain2 committed Nov 8, 2017
1 parent 47eec83 commit af2e6de
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Param(
[Alias("vs")]
[System.String] $VersionSuffix = "dev",

[Parameter(Mandatory=$false)]
[Alias("bn")]
[System.String] $BuildNumber = "49999999-99",

[Parameter(Mandatory=$false)]
[Alias("ff")]
[System.Boolean] $FailFast = $true,
Expand Down Expand Up @@ -691,11 +695,11 @@ function Update-VsixVersion($vsixProjectDir)
$packageDir = Get-FullCLRPackageDirectory
$vsixVersion = $Version

# VersionSuffix in microbuild comes in the form preview-20170111-01(preview-yyyymmdd-buildNoOfThatDay)
# Build number comes in the form 20170111-01(yyyymmdd-buildNoOfThatDay)
# So Version of the vsix will be 15.1.0.2017011101
$vsixVersionSuffix = $VersionSuffix.Split("-");
$vsixVersionSuffix = $BuildNumber.Split("-");
if($vsixVersionSuffix.Length -ige 2) {
$vsixVersion = "$vsixVersion.$($vsixVersionSuffix[1])$($vsixVersionSuffix[2])"
$vsixVersion = "$vsixVersion.$($vsixVersionSuffix[0])$($vsixVersionSuffix[1])"
}

$manifestContentWithVersion = Get-Content "$vsixProjectDir\source.extension.vsixmanifest" -raw | % {$_.ToString().Replace("`$version`$", "$vsixVersion") }
Expand Down

0 comments on commit af2e6de

Please sign in to comment.