-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.bat
64 lines (45 loc) · 2.22 KB
/
Build.bat
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
@setlocal
@set local=%~dp0
@ECHO off
@set CtxErrCode=0
@REM Get path to MSBuild Binaries
if exist "%windir%\Microsoft.NET\Framework64\v4.0.30319" SET MSBUILDEXEDIR=%windir%\Microsoft.NET\Framework64\v4.0.30319
if exist "%windir%\Microsoft.NET\Framework\v4.0.30319" SET MSBUILDEXEDIR=%windir%\Microsoft.NET\Framework\v4.0.30319
if exist "%ProgramFiles(x86)%\MSBuild\14.0\bin" SET MSBUILDEXEDIR=%ProgramFiles(x86)%\MSBuild\14.0\bin
if exist "%ProgramFiles%\MSBuild\14.0\bin" SET MSBUILDEXEDIR=%ProgramFiles%\MSBuild\14.0\bin
if exist "%ProgramFiles(x86)%\MSBuild\15.0\bin" SET MSBUILDEXEDIR=%ProgramFiles(x86)%\MSBuild\15.0\bin
if exist "%ProgramFiles%\MSBuild\15.0\bin" SET MSBUILDEXEDIR=%ProgramFiles%\MSBuild\15.0\bin
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin" SET MSBUILDEXEDIR=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin" SET MSBUILDEXEDIR=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin" SET MSBUILDEXEDIR=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin
@REM Can't multi-block if statement when check condition contains '(' and ')' char, so do as single line checks
if NOT "%MSBUILDEXEDIR%" == "" SET MSBUILDEXE=%MSBUILDEXEDIR%\MSBuild.exe
if "%MSBUILDEXEDIR%" == "" GOTO :MsBuildNotFound
if NOT "%MSBUILDEXEDIR%" == "" GOTO :MsBuildFound
:MsBuildFound
@ECHO MsBuild Location = %MSBUILDEXE%
@goto build
:build
@ECHO Installing packages...
"%local%.nuget\NuGet.exe" restore "%local%LetsEncryptCentral.sln"
@ECHO Building...
"%MSBUILDEXE%" "%local%LetsEncryptCentral.sln" /t:Rebuild /P:Configuration=Release
IF ERRORLEVEL 1 (
SET CtxErrCode=%ERRORLEVEL%
GOTO :end
)
@goto copy
:copy
robocopy "%local%src\LetsEncryptCentral\bin\Release" "%local%release" /e
@goto pack
:pack
@rem %local%\.nuget\NuGet pack %local%\src\MyProj\MyProj.nuspec -OutputDirectory %local%\release
@goto end
:MsBuildNotFound
@echo Could not found msbuild
@SET CtxErrCode=4
@goto end
:end
@pushd %local%
IF NOT "%CtxErrCode%" == "0" EXIT /B %CtxErrCode%
EXIT /B %ERRORLEVEL%