Skip to content

Commit 88e7c7c

Browse files
Fixing Get-MSBuildPathV2 for version < 15 (#447)
1 parent ffb99c5 commit 88e7c7c

11 files changed

+29
-297
lines changed

common-npm-packages/azure-arm-rest/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common-npm-packages/azure-arm-rest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "azure-pipelines-tasks-azure-arm-rest",
3-
"version": "3.254.2",
3+
"version": "3.256.0",
44
"description": "Common Lib for Azure ARM REST apis",
55
"repository": {
66
"type": "git",

common-npm-packages/msbuildhelpers/PathFunctions.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ function Get-MSBuildPathV2 {
187187
Write-Debug "Exception caught while parsing VersionNumber : $_"
188188
}
189189

190-
$specifiedStudio = Get-VisualStudio $VersionNumber
191190
if (($VersionNumber -ge 15 -or !$Version) -and # !$Version indicates "latest"
192191
($specifiedStudio = Get-VisualStudio $VersionNumber) -and
193192
$specifiedStudio.installationPath) {

common-npm-packages/msbuildhelpers/Tests/Select-MSBuildPath.ErrorsIfVersionNotFound.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ Assert-WasCalled Get-MSBuildPath -- -Version '15.0' -Architecture 'Some architec
1313
Assert-WasCalled Get-MSBuildPath -- -Version '14.0' -Architecture 'Some architecture'
1414
Assert-WasCalled Get-MSBuildPath -- -Version '12.0' -Architecture 'Some architecture'
1515
Assert-WasCalled Get-MSBuildPath -- -Version '4.0' -Architecture 'Some architecture'
16-
Assert-WasCalled Get-MSBuildPath -Times 6
16+
17+
$expectedCallCount = if ($env:MSBUILDHELPERS_ENABLE_TELEMETRY -eq "true") { 12 } else { 6 }
18+
Assert-WasCalled Get-MSBuildPath -Times $expectedCallCount

common-npm-packages/msbuildhelpers/Tests/Select-MSBuildPath.FallsBackFrom14.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ $actual = Select-MSBuildPath -Method 'Version' -Location '' -PreferredVersion '1
1212

1313
# Assert.
1414
Assert-WasCalled Write-Warning
15-
Assert-WasCalled Get-MSBuildPath -Times 5
15+
16+
$expectedCallCount = if ($env:MSBUILDHELPERS_ENABLE_TELEMETRY -eq "true") { 10 } else { 5 }
17+
Assert-WasCalled Get-MSBuildPath -Times $expectedCallCount
18+
1619
Assert-AreEqual -Expected 'Some resolved location' -Actual $actual

common-npm-packages/msbuildhelpers/Tests/Select-MSBuildPath.FallsBackFrom15.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ $actual = Select-MSBuildPath -Method 'Version' -Location '' -PreferredVersion '1
1212

1313
# Assert.
1414
Assert-WasCalled Write-Warning
15-
Assert-WasCalled Get-MSBuildPath -Times 4
15+
16+
$expectedCallCount = if ($env:MSBUILDHELPERS_ENABLE_TELEMETRY -eq "true") { 8 } else { 4 }
17+
Assert-WasCalled Get-MSBuildPath -Times $expectedCallCount
18+
1619
Assert-AreEqual -Expected 'Some resolved location' -Actual $actual

common-npm-packages/msbuildhelpers/Tests/Select-MSBuildPath.FallsForwardFrom12.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ $actual = Select-MSBuildPath -Method 'Version' -Location '' -PreferredVersion '1
1212

1313
# Assert.
1414
Assert-WasCalled Write-Warning
15-
Assert-WasCalled Get-MSBuildPath -Times 5
15+
16+
$expectedCallCount = if ($env:MSBUILDHELPERS_ENABLE_TELEMETRY -eq "true") { 10 } else { 5 }
17+
Assert-WasCalled Get-MSBuildPath -Times $expectedCallCount
18+
1619
Assert-AreEqual -Expected 'Some resolved location' -Actual $actual

common-npm-packages/msbuildhelpers/Tests/Select-MSBuildPath.FallsForwardFrom14.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ $actual = Select-MSBuildPath -Method 'Version' -Location '' -PreferredVersion '1
1212

1313
# Assert.
1414
Assert-WasCalled Write-Warning
15-
Assert-WasCalled Get-MSBuildPath -Times 4
15+
16+
$expectedCallCount = if ($env:MSBUILDHELPERS_ENABLE_TELEMETRY -eq "true") { 8 } else { 4 }
17+
Assert-WasCalled Get-MSBuildPath -Times $expectedCallCount
18+
1619
Assert-AreEqual -Expected 'Some resolved location' -Actual $actual

common-npm-packages/msbuildhelpers/Tests/Select-MSBuildPath.ReturnsLatestVersion.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ foreach ($version in @('', 'latest')) {
1313

1414
# Assert.
1515
Assert-AreEqual -Expected 'Some resolved location' -Actual $actual
16-
Assert-WasCalled Get-MSBuildPath -Times 2
16+
17+
$expectedCallCount = if ($env:MSBUILDHELPERS_ENABLE_TELEMETRY -eq "true") { 4 } else { 2 }
18+
Assert-WasCalled Get-MSBuildPath -Times $expectedCallCount
1719
}

common-npm-packages/msbuildhelpers/package-lock.json

Lines changed: 3 additions & 286 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)