PSCI icon indicating copy to clipboard operation
PSCI copied to clipboard

[feature] Support for msbuild 15.0

Open gstrzelecki opened this issue 8 years ago • 5 comments

There is a new version of msbuild, the 15.0. I'm just wondering how to update the Get-MSBuildPath and I'm thinking about using https://github.com/microsoft/vssetup.powershell.

Do you think it is a good idea? How to declare such dependency to external module?

gstrzelecki avatar Jul 31 '17 10:07 gstrzelecki

I would rather look at https://github.com/Microsoft/vswhere - I understand it's installed with VS 2017 so it should be a matter of invoking it from command line (you could just extend Get-MSBuildPath) instead of including a module that looks pretty heavy.

Alternatively, if you really wish to add external dependency globally, it should be matter of adding it to https://github.com/ObjectivityLtd/PSCI/blob/master/build/psci.depend.psd1 and possibly to https://github.com/ObjectivityLtd/PSCI/blob/master/PSCI/PSCI.psm1 (similarly to PPoShTools).

mgr32 avatar Jul 31 '17 12:07 mgr32

Great idea with vssetup, but I'm not sure whether we can be sure that Visual Studio is installed on a build server. In the theory there is a separated installer: https://www.visualstudio.com/pl/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15#

gstrzelecki avatar Aug 02 '17 06:08 gstrzelecki

I just found the answer in https://github.com/Microsoft/vswhere/issues/61 and https://github.com/Microsoft/vswhere/wiki/Find-MSBuild. I need the advice - how to ensure that vswhere tool is available for PSCI?

gstrzelecki avatar Aug 02 '17 07:08 gstrzelecki

You could just download it (possibly lazily in Get-MSBuildPath) using Invoke-WebRequest from https://github.com/Microsoft/vswhere/releases/download/2.1.3/vswhere.exe, ideally to a directory that is not deleted between builds. Alternatively, you could install it with choco install vswhere, but then you would probably also need to write a function that installs Choco if it's not available :)

mgr32 avatar Aug 02 '17 07:08 mgr32

Example of using Powershell Gallery (unfortunately vswhere doesn't seem to be available at Powershell Gallery) - current version of build bootstrap: https://github.com/ObjectivityLtd/PSCI/blob/master/examples/various/BuildDeploy/build.ps1

Example of using Nuget - old version of build bootstrap: https://github.com/ObjectivityLtd/PSCI/blob/db2f84f3e7258e2fb08088cd66aa233f9ca88398/examples/various/BuildDeploy/build.ps1

mgr32 avatar Aug 02 '17 07:08 mgr32