chocolatey / Chocolatey.Cake.Recipe

A set of convention based Cake scripts for building Chocolatey projects
Apache License 2.0
5 stars 9 forks source link

(#93) Add support for resolving VS with VSWhere #94

Closed AdmiringWorm closed 1 year ago

AdmiringWorm commented 1 year ago

Description Of Changes

This pull request adds new handling in the ToolsSettings class to resolve to the actual instance of an AMD64 MSBuild executable to ensure we are using either the supported VS studio instance or the latest instance available.

Motivation and Context

This change is made due to the version of cake that we are currently using isn't able to resolve to a Visual Studio 2022 instance, or if an instance is installed to a custom directory.

Testing

  1. Copy the files over to a local close of the chocolatey/choco repository.
  2. Update the call to SetToolSettings and iterate through each enumeration value for MSBuildToolSettings that can be set
  3. Verify the correct installation of Visual Studio is picked up.

NOTE: Due to not having any legacy installations of Visual Studio installed (2017 and below), I was not able to correctly assert this resolving

Change Types Made

Related Issue

Fixes #93

Change Checklist

gep13 commented 1 year ago

@AdmiringWorm just taken this for a spin, and all of this looks good to me! Thanks for getting this added!