-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathBuild.bat
143 lines (116 loc) · 4.06 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
echo off
echo.
echo =========================================================
echo Build
echo Builds the Application
echo =========================================================
echo.
set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v3.5
set solutionDir="."
set buildType=Debug
set returnErrorCode=true
set pause=true
set SolutionName="CABDevExpress.ExtensionKit.sln"
if "%1"=="/?" goto HELP
if not Exist %solutionDir%\%SolutionName% goto HELP
@REM ----------------------------------------------------
@REM If the first parameter is /q, do not pause
@REM at the end of execution.
@REM ----------------------------------------------------
if /i "%1"=="/q" (
set pause=false
SHIFT
)
@REM ----------------------------------------------------
@REM If the first or second parameter is /i, do not
@REM return an error code on failure.
@REM ----------------------------------------------------
if /i "%1"=="/i" (
set returnErrorCode=false
SHIFT
)
@REM ----------------------------------------------------
@REM User can override default build type by specifiying
@REM a parameter to batch file (e.g. BuildLibrary Debug).
@REM ----------------------------------------------------
if not "%1"=="" set buildType=%1
set OutputDir=..\Bin\%buildType%\
@REM ------------------------------------------------
@REM Shorten the command prompt for making the output
@REM easier to read.
@REM ------------------------------------------------
set savedPrompt=%prompt%
set prompt=*$g
@ECHO ----------------------------------------
@ECHO BuildLibrary.bat Started
@ECHO ----------------------------------------
@ECHO.
@REM -------------------------------------------------------
@REM Change to the directory where the solution file resides
@REM -------------------------------------------------------
pushd %solutionDir%
@REM -------------------------------------------------------
@REM Change to the directory where the solution file resides
@REM -------------------------------------------------------
if "%DevEnvDir%"=="" (
@ECHO ------------------------------------------
@ECHO Setting build environment
@ECHO ------------------------------------------
@CALL "%VS80COMNTOOLS%\vsvars32.bat" > NUL
)
@ECHO.
@ECHO -------------------------------------------
@ECHO Building the Enterprise Library assemblies
@ECHO -------------------------------------------
call %msBuildDir%\msbuild %SolutionName% /t:Rebuild /p:Configuration=%buildType% /property:OutDir=%OutputDir%
@if errorlevel 1 goto :error
@ECHO.
@ECHO ----------------------------------------
@ECHO BuildLibrary.bat Completed
@ECHO ----------------------------------------
@ECHO.
@REM ----------------------------------------
@REM Restore the command prompt and exit
@REM ----------------------------------------
@goto :exit
@REM -------------------------------------------
@REM Handle errors
@REM
@REM Use the following after any call to exit
@REM and return an error code when errors occur
@REM
@REM if errorlevel 1 goto :error
@REM -------------------------------------------
:error
if %returnErrorCode%==false goto exit
@ECHO An error occured in Build.bat - %errorLevel%
if %pause%==true PAUSE
@exit errorLevel
:HELP
echo Usage: Build [/q] [/i] [build type]
echo.
echo BuildLibrary is to be executed in the directory where EntLibContrib.sln resides
echo The default build type is Debug.
echos.
echo If the first or second parameter is /i, do not return an error code on failure.
echo If the first parameter is /q, do not pause at the end of execution.
echo.
echo Examples:
echo.
echo "Build" - builds a Debug build
echo "Build Release" - builds a Release build
echo.
@REM ----------------------------------------
@REM The exit label
@REM ----------------------------------------
:exit
if %pause%==true PAUSE
popd
set pause=
set solutionDir=
set buildType=
set returnErrorCode=
set prompt=%savedPrompt%
set savedPrompt=
set SolutionName=
echo on