Skip to content

Commit

Permalink
Merge pull request #339: Pass all required components to vswhere in B…
Browse files Browse the repository at this point in the history
…uildGVFSForWindows.bat
  • Loading branch information
jrbriggs authored Oct 5, 2018
2 parents 9bdca0b + 25dab5d commit 0c13294
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ If you'd like to build your own VFS for Git Windows installer:
* .NET Core cross-platform development
* Include the following additional components:
* .NET Core runtime
* C++/CLI support
* Windows 10 SDK (10.0.10240.0)
* Install the .NET Core 2.1 SDK (https://www.microsoft.com/net/download/dotnet-core/2.1)
* Create a folder to clone into, e.g. `C:\Repos\VFSForGit`
Expand Down
12 changes: 9 additions & 3 deletions Scripts/BuildGVFSForWindows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ SET vswhere=%~dp0..\..\packages\vswhere.%vswherever%\tools\vswhere.exe

:: Use vswhere to find the latest VS installation (including prerelease installations) with the msbuild component.
:: See https://github.com/Microsoft/vswhere/wiki/Find-MSBuild
for /f "usebackq tokens=*" %%i in (`%vswhere% -all -prerelease -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
for /f "usebackq tokens=*" %%i in (`%vswhere% -all -prerelease -latest -products * -requires Microsoft.Component.MSBuild Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.Component.NetFX.Core.Runtime Microsoft.VisualStudio.Component.Windows10SDK.10240 -property installationPath`) do (
set VsInstallDir=%%i
)

IF NOT DEFINED VsInstallDir (
echo ERROR: Could not locate a Visual Studio installation with required components.
echo Refer to Readme.md for a list of the required Visual Studio components.
exit /b 10
)

SET msbuild="%VsInstallDir%\MSBuild\15.0\Bin\amd64\msbuild.exe"
IF NOT EXIST %msbuild% (
echo Error: Could not find msbuild
exit /b 1
echo ERROR: Could not find msbuild
exit /b 1
)

%msbuild% %~dp0\..\GVFS.sln /p:GVFSVersion=%GVFSVersion% /p:Configuration=%SolutionConfiguration% /p:Platform=x64 || exit /b 1
Expand Down

0 comments on commit 0c13294

Please sign in to comment.