Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about VSBuild task #4441

Closed
mmajcica opened this issue Jun 1, 2017 · 2 comments
Closed

Question about VSBuild task #4441

mmajcica opened this issue Jun 1, 2017 · 2 comments

Comments

@mmajcica
Copy link
Contributor

mmajcica commented Jun 1, 2017

In the latest version I do see that you used vswhere.exe as the VS Locator. My question is, is there a reason for that, against using using vssetup https://github.com/Microsoft/vssetup.powershell?

Thanks

@ericsciple
Copy link
Contributor

No special advantage. I liked the simplicity of calling a command line tool. We need to call vswhere from multiple places: agent for capability scan and 4 tasks msbuild, vsbuild, vstest, xamarinandroid. The pattern of calling a command line tool is most flexible (vstest task is written in typescript).

@mmajcica
Copy link
Contributor Author

mmajcica commented Jun 6, 2017

As I had the same need in my code (retrieve VS path), I took a peak at your code. Using vssetup PS library turned out to be much more elegant solution in my case. Not only, it is about 5X smaller in size then vswhere thus the size of my build task is drastically smaller.
This means that in the https://github.com/Microsoft/vsts-tasks/blob/master/Tasks/Common/MSBuildHelpers/PathFunctions.ps1 the whole function function Get-VisualStudio_15_0 can be removed and the function Get-MSBuildPath can change the following:

if (($Version -eq "15.0" -or !$Version) -and # !$Version indicates "latest"
            ($visualStudio15 = Get-VisualStudio_15_0) -and
            $visualStudio15.installationPath) {

can change into:

# Search for a 15.0 Willow instance.
            if ($Version -eq "15.0" -and ($instance = Get-VSSetupInstance | Select-VSSetupInstance -Version '[15.0,)') -and $instance.installationPath)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants