提交 89a4b504 编写于 作者: J Jared Parsons

Properly detect the Visual Studio version to install into

上级 64f1ac91
...@@ -241,9 +241,9 @@ function Get-MSBuildDir([switch]$xcopy = $false) { ...@@ -241,9 +241,9 @@ function Get-MSBuildDir([switch]$xcopy = $false) {
return $both[1] return $both[1]
} }
# Get the directory of the first Visual Studio which meets our minimal # Get the directory and instance ID of the first Visual Studio version which
# requirements for the Roslyn repo # meets our minimal requirements for the Roslyn repo.
function Get-VisualStudioDir() { function Get-VisualStudioDirAndId() {
$vswhere = Join-Path (Ensure-BasicTool "vswhere") "tools\vswhere.exe" $vswhere = Join-Path (Ensure-BasicTool "vswhere") "tools\vswhere.exe"
$output = & $vswhere -requires Microsoft.Component.MSBuild -format json | Out-String $output = & $vswhere -requires Microsoft.Component.MSBuild -format json | Out-String
if (-not $?) { if (-not $?) {
...@@ -251,8 +251,15 @@ function Get-VisualStudioDir() { ...@@ -251,8 +251,15 @@ function Get-VisualStudioDir() {
} }
$j = ConvertFrom-Json $output $j = ConvertFrom-Json $output
$p = $j[0].installationPath Write-Output $j[0].installationPath
return $p Write-Output $j[0].instanceId
}
# Get the directory of the first Visual Studio which meets our minimal
# requirements for the Roslyn repo
function Get-VisualStudioDir() {
$both = Get-VisualStudioDirAndId
return $both[0]
} }
# Clear out the NuGet package cache # Clear out the NuGet package cache
......
...@@ -257,10 +257,12 @@ function Test-XUnit() { ...@@ -257,10 +257,12 @@ function Test-XUnit() {
# Deploy our core VSIX libraries to Visual Studio via the Roslyn VSIX tool. This is an alternative to # Deploy our core VSIX libraries to Visual Studio via the Roslyn VSIX tool. This is an alternative to
# deploying at build time. # deploying at build time.
function Deploy-VsixViaTool() { function Deploy-VsixViaTool() {
$vsixDir = Get-PackageDir "roslyntools.microsoft.vsixexpinstaller" $vsixDir = Get-PackageDir "roslyntools.microsoft.vsixexpinstaller"
$vsixExe = Join-Path $vsixDir "tools\VsixExpInstaller.exe" $vsixExe = Join-Path $vsixDir "tools\VsixExpInstaller.exe"
$vsDir = [IO.Path]::GetFullPath("$msbuildDir\..\..\..\").Trim("\") $both = Get-VisualStudioDirAndId
$vsDir = $both[0].Trim("\")
$vsId = $both[1]
Write-Host "Using VS Instance $vsId at `"$vsDir`""
$baseArgs = "/rootSuffix:RoslynDev /vsInstallDir:`"$vsDir`"" $baseArgs = "/rootSuffix:RoslynDev /vsInstallDir:`"$vsDir`""
$all = @( $all = @(
"Vsix\CompilerExtension\Roslyn.Compilers.Extension.vsix", "Vsix\CompilerExtension\Roslyn.Compilers.Extension.vsix",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册