Skip to content

Commit

Permalink
Merge pull request #3600 from devlead/feature/gh-3598/gh-3599
Browse files Browse the repository at this point in the history
GH-3598:,GH-3599: VS2022 MSBuild remove preview  & add to default
  • Loading branch information
devlead authored Oct 13, 2021
2 parents 90e857f + caf09ac commit 55d7d94
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/Cake.Common.Tests/Fixtures/Tools/MSBuildRunnerFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public MSBuildRunnerFixture(bool is64BitOperativeSystem, PlatformFamily platform
"/Program86/Microsoft Visual Studio/2017/Enterprise/MSBuild/15.0/Bin/amd64/MSBuild.exe",
"/Program86/Microsoft Visual Studio/2019/Professional/MSBuild/Current/Bin/MSBuild.exe",
"/Program86/Microsoft Visual Studio/2019/Professional/MSBuild/Current/Bin/amd64/MSBuild.exe",
"/Program/Microsoft Visual Studio/2022/Preview/MSBuild/Current/Bin/MSBuild.exe",
"/Program/Microsoft Visual Studio/2022/Preview/MSBuild/Current/Bin/amd64/MSBuild.exe",
"/Program/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe",
"/Program/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/amd64/MSBuild.exe",
"/usr/bin/msbuild",
"/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild"
};
Expand Down Expand Up @@ -77,6 +77,7 @@ public void GivenMSBuildIsNotInstalled()
}
FileSystem.GetDirectory("/Windows").Delete(true);
FileSystem.GetDirectory("/Program86").Delete(true);
FileSystem.GetDirectory("/Program").Delete(true);
}

protected override void RunTool()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ public void Should_Get_Correct_Path_To_MSBuild_Version_16(MSBuildToolVersion ver
}

[Theory]
[InlineData(MSBuildToolVersion.VS2022, PlatformTarget.x64, PlatformFamily.Windows, false, "/Program/Microsoft Visual Studio/2022/Preview/MSBuild/Current/Bin/amd64/MSBuild.exe")]
[InlineData(MSBuildToolVersion.VS2022, PlatformTarget.x86, PlatformFamily.Windows, false, "/Program/Microsoft Visual Studio/2022/Preview/MSBuild/Current/Bin/MSBuild.exe")]
[InlineData(MSBuildToolVersion.VS2022, PlatformTarget.x64, PlatformFamily.Windows, false, "/Program/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/amd64/MSBuild.exe")]
[InlineData(MSBuildToolVersion.VS2022, PlatformTarget.x86, PlatformFamily.Windows, false, "/Program/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe")]
[InlineData(MSBuildToolVersion.VS2022, PlatformTarget.x64, PlatformFamily.Linux, false, "/usr/bin/msbuild")]
[InlineData(MSBuildToolVersion.VS2022, PlatformTarget.x64, PlatformFamily.OSX, false, "/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild")]
public void Should_Get_Correct_Path_To_MSBuild_Version_17(MSBuildToolVersion version, PlatformTarget target, PlatformFamily family, bool is64BitOperativeSystem, string expected)
Expand Down
5 changes: 2 additions & 3 deletions src/Cake.Common/Tools/MSBuild/MSBuildResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private static DirectoryPath GetHighestAvailableMSBuildVersion(IFileSystem fileS
{
var versions = new[]
{
// MSBuildVersion.MSBuild17, /*Since it's still in preview, do not search unless specified. Uncomment after stable version released*/
MSBuildVersion.MSBuild17,
MSBuildVersion.MSBuild16,
MSBuildVersion.MSBuild15,
MSBuildVersion.MSBuild14,
Expand Down Expand Up @@ -212,8 +212,7 @@ private static DirectoryPath GetVisualStudio2022Path(IFileSystem fileSystem, ICa
"Enterprise",
"Professional",
"Community",
"BuildTools",
"Preview" // Remove after stable version released
"BuildTools"
};

var visualStudio2022Path = environment.GetSpecialPath(SpecialPath.ProgramFiles);
Expand Down

0 comments on commit 55d7d94

Please sign in to comment.