forked from dotnet/codeformatter
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.cmd
More file actions
Latest commit
38 lines (32 loc) · 1.38 KB
/
Copy pathbuild.cmd
File metadata and controls
38 lines (32 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@ECHOOFF
SETLOCAL
SETCACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe
SETSOLUTION_PATH="%~dp0src\CodeFormatter.sln"
SETMSBUILD14_TOOLS_PATH="%ProgramFiles(x86)%\MSBuild\14.0\bin\MSBuild.exe"
SETMSBUILD12_TOOLS_PATH="%ProgramFiles(x86)%\MSBuild\12.0\bin\MSBuild.exe"
SETBUILD_TOOLS_PATH=%MSBUILD14_TOOLS_PATH%
IFNOTEXIST%MSBUILD14_TOOLS_PATH% (
echo In order to run this tool you need either Visual Studio 2015 or
echo Microsoft Build Tools 2015 tools installed.
echo.
echo Visit this page to download either:
echo.
echo http://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs
echo.
echo Attempting to fall back to MSBuild 12 for building only
echo.
IFNOTEXIST%MSBUILD12_TOOLS_PATH% (
echo Could not find MSBuild 12. Please install build tools ^(See above^)
exit /b 1
) else (
setBUILD_TOOLS_PATH=%MSBUILD12_TOOLS_PATH%
)
)
IFEXIST%CACHED_NUGET%goto restore
echo Downloading latest version of NuGet.exe...
IFNOTEXIST%LocalAppData%\NuGet md%LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"
:restore
IFNOTEXIST src\packages md src\packages
%CACHED_NUGET% restore %SOLUTION_PATH%
%BUILD_TOOLS_PATH%%SOLUTION_PATH% /p:OutDir="%~dp0bin" /nologo /m /v:m /flp:verbosity=normal %*