-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Example scripts to locate and run msbuild
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="vswhere" version="2.2.11" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@REM Copyright (C) Microsoft Corporation. All rights reserved. | ||
@REM Licensed under the MIT license. See LICENSE.txt in the project root for license information. | ||
|
||
@if not defined _echo echo off | ||
setlocal enabledelayedexpansion | ||
|
||
@REM Determine if MSBuild is already in the PATH | ||
for /f "usebackq delims=" %%I in (`where msbuild.exe 2^>nul`) do ( | ||
"%%I" %* | ||
exit /b !ERRORLEVEL! | ||
) | ||
|
||
@REM Find the latest MSBuild that supports our projects | ||
for /f "usebackq delims=" %%I in (`call "%~dp0vswhere.cmd" -version "[15.0,)" -latest -prerelease -products * -requires Microsoft.Component.MSBuild Microsoft.VisualStudio.Component.Roslyn.Compiler Microsoft.VisualStudio.Component.VC.140 -property InstallationPath`) do ( | ||
for /f "usebackq delims=" %%J in (`where /r "%%I\MSBuild" msbuild.exe 2^>nul ^| sort /r`) do ( | ||
"%%J" %* | ||
exit /b !ERRORLEVEL! | ||
) | ||
) | ||
|
||
echo Could not find msbuild.exe 1>&2 | ||
exit /b 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@REM Copyright (C) Microsoft Corporation. All rights reserved. | ||
@REM Licensed under the MIT license. See LICENSE.txt in the project root for license information. | ||
|
||
@if not defined _echo echo off | ||
setlocal enabledelayedexpansion | ||
|
||
for /f "usebackq delims=" %%I in (`dir /b /aD /o-N /s "%~dp0..\packages\vswhere*"`) do ( | ||
for /f "usebackq delims=" %%J in (`where /r "%%I" vswhere.exe 2^>nul`) do ( | ||
"%%J" %* | ||
exit /b !ERRORLEVEL! | ||
) | ||
) |