-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBuild.bat
286 lines (246 loc) · 8.56 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
@ECHO OFF
rem CLS
COLOR 1B
TITLE XBMC Build Prepare Script
rem ----PURPOSE----
rem - Create a working XBMC build with a single click
rem -------------------------------------------------------------
rem Usage: built.bat [noprompt] [nocompress] [noclean] [build1-4]
rem -------------------------------------------------------------
rem Config
rem If you get an error that Visual studio was not found, SET your path for VSNET main executable.
rem ONLY needed if you have a very old bios, SET the path for xbepatch. Not needed otherwise.
rem -------------------------------------------------------------
rem CONFIG START
SET XBE_PATCH=tools\xbepatch\xbepatch.exe
SET COMPRESS_FILE=XBMC4XBOX.zip
SET COMPRESS=C:\Program Files\7-zip\7z.exe
SET COMPRESS_OPTS=a %COMPRESS_FILE%
SET Silent=0
SET SkipCompression=0
SET Clean=1
SET Compile=1
IF "%VS71COMNTOOLS%"=="" (
SET NET="%ProgramFiles%\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.com"
) ELSE (
SET NET="%VS71COMNTOOLS%\..\IDE\devenv.com"
)
IF NOT EXIST %NET% (
CALL:ERROR "Visual Studio .NET 2003 was not found."
GOTO:EOF
)
:GETPARAMS
set IN=%1
IF "%IN%" EQU "noprompt" (
SET Silent=1
) ELSE IF "%IN%" EQU "nocompress" (
SET SkipCompression=1
) ELSE IF "%IN%" EQU "noclean" (
SET Clean=0
) ELSE IF "%IN:~0,5%" EQU "build" (
SET XBMC_COMPILE_ANSWER=%IN:~5,1%
SET Silent=1
) ELSE IF "%IN%" EQU "" (
GOTO ENDPARAMS
)
SHIFT
GOTO GETPARAMS
:ENDPARAMS
IF %Silent% EQU 0 (
CALL:MENU
)
SET DEST=BUILD
IF %XBMC_COMPILE_ANSWER% EQU 1 (
SET VS_PATH=.
SET VS_SOL=xbmc.sln
SET VS_CONF=Release
SET VS_BIN=default.xbe
)
IF %XBMC_COMPILE_ANSWER% EQU 2 (
SET VS_PATH=.
SET VS_SOL=xbmc.sln
SET VS_CONF=Release_LTCG
SET VS_BIN=default.xbe
)
IF %XBMC_COMPILE_ANSWER% EQU 3 (
SET VS_PATH=.
SET VS_SOL=xbmc.sln
SET VS_CONF=Debug
SET VS_BIN=default.xbe
)
IF %XBMC_COMPILE_ANSWER% EQU 4 (
SET DEST=BUILD_WIN32
SET VS_PATH=tools\Win32
SET VS_SOL=XBMC_PC.sln
SET VS_CONF=Release
SET VS_BIN=XBMC_PC.exe
)
IF %XBMC_COMPILE_ANSWER% EQU "" GOTO:EOF
IF %Silent% EQU 0 (
IF EXIST %VS_PATH%\%VS_CONF%\%VS_BIN% (
CALL:BIN_EXISTS
)
)
IF %Compile% EQU 1 (
CALL:COMPILE
)
CALL:MAKE_BUILD %DEST%
ECHO ------------------------------------------------------------
ECHO Build Succeeded!
IF %SkipCompression%==0 (
CALL:COMPRESS %DEST%
)
IF %Silent% EQU 0 (
CALL:VIEWLOG
)
pause
GOTO:EOF
:MENU
ECHO ²²²²²²²±±±±±±±±°°°°°°°
ECHO ²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ²²²²²²±±±±±°°°°°° ßßß²ÜÜ
ECHO ÞÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ²²²²±±±°° ßßÜ
ECHO ²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ²° Ý
ECHO ²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ° ²
ECHO ±ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÝ°ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ Þ
ECHO °ÛÛÛÛÛÛ²±° ßÛß ßÛÛÛß ß²ß ßÛÛÛß °²ÛÛÛ Þ
ECHO ÛÛÛÛÛÛÛÛÛÛÝ ÜÛÛÛÝ ²ÛÛÛÜ ÞÛÝ Ü²ÛÜ ÜÛÛÜ ÞÛ ÜÛÛÛÛÛÛÛ Þ
ECHO ²ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÝ ÛÛÛÛÛÝ Û ÞÛÛÛÛÝ ÞÛÛÛÛÝ Ý ÞÛÛÛÛÛÛÛÛ ²
ECHO ±ÛÛÛÛÛÛÛÛÛÝ ÞÛÛÛÛÛÝ ÛÛÛÛÛÝ Û ÛÛÛÛÛÝ ÛÛÛÛÛÝ ²ÛÛÛÛÛÛÛ² Ý
ECHO °²ÛÛÛÛÛÛÛß ßÛÛÛÛÝ ßÛÛÛß ÞÝ ÛÛÛÛÛÝ ÛÛÛÛÛÝ ° ßÛÛÛÛÛÛÛÝ Ý
ECHO ±ÛÛÛ²±° ÜÛÛÜ °±²ÛÛÜ ÜÛ²ÜÛÛÛÛÛÛÜÛÛÛÛÛ² ÛÜ °²ÛÛÛÝÞ
ECHO °²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ²
ECHO ±ÛÛÛÛÛßßßßÛßßÛßßÛÛßÛÛßÛÛÛÛßßÛßßÛßßßÛßßÛßßÛßßÛÛÛÛÛÛÛ Ý
ECHO °²ÛÛÛÛ ÝÞ Û ßÛ Û Û ÛÝÜÞÛÛÛ ÛÛ ßÛ Û ÛÝÞÛ ßÛ ßÜÛÛÛÛÛ± Ý
ECHO ±ÛÛÛÛ ÝÞ Û ßÛ ßÜÛ Û Ü ÛÛÛ ßÛ ßÛ Û ÛÝÞÛ ßÛ Û ÛÛÛÛÛ°Þ
ECHO °²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ²
ECHO ±°ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ °±²²²²
ECHO °²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ²°°±²ß
ECHO ±²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ²Û²²ßßßß
ECHO ²²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ²Û²²ßßßß
ECHO ß²ÛÛÛÛ²Û²²²ßßßßßß
ECHO ------------------------------------------------------------
ECHO XBMC prepare menu
ECHO ------------------------------------------------------------
ECHO [1] Build XBMC XBE ( for XBOX use )
ECHO [2] Build LTCG XBMC XBE ( for XBOX use )
ECHO [3] Build DEBUG XBE ( for XBOX use )
ECHO [4] Build XBMC_WIN32 ( for Windows use)
ECHO ------------------------------------------------------------
SET /P XBMC_COMPILE_ANSWER=Please enter the number you want to build [1/2/3/4]:
GOTO:EOF
:BIN_EXISTS
ECHO ------------------------------------------------------------
ECHO Found a previous Compiled binary - %VS_PATH%\%VS_CONF%\%VS_BIN% !
ECHO [1] a NEW binary will be compiled for the BUILD
ECHO [2] existing binary will be updated (quick mode compile) for the BUILD
ECHO [3] existing binary will be used for the BUILD
ECHO ------------------------------------------------------------
SET /P XBMC_COMPILE_ANSWER=Compile a new binary? [1/2/3]:
IF /I %XBMC_COMPILE_ANSWER% EQU 1 SET Clean=1
IF /I %XBMC_COMPILE_ANSWER% EQU 2 SET Clean=0
IF /I %XBMC_COMPILE_ANSWER% EQU 3 SET Compile=0
GOTO:EOF
:COMPILE
ECHO Wait while preparing the build.
ECHO ------------------------------------------------------------
IF %Clean% EQU 1 (
ECHO Cleaning Solution...
%NET% %VS_PATH%\%VS_SOL% /clean %VS_CONF%
DEL %VS_PATH%\%VS_CONF%\xbmc.map 2>NUL
)
ECHO Compiling Solution...
call "Fix GIT Empty Folders.bat"
%NET% %VS_PATH%\%VS_SOL% /build %VS_CONF%
IF NOT EXIST %VS_PATH%\%VS_CONF%\%VS_BIN% (
CALL:ERROR "%VS_BIN% failed to build! See .\%VS_CONF%\BuildLog.htm for details."
CALL:VIEWLOG
PAUSE
EXIT
)
ECHO Done!
ECHO ------------------------------------------------------------
GOTO:EOF
:MAKE_BUILD
RMDIR %~1 /S /Q
MKDIR %~1
ECHO Copying files to %~1 ...
xcopy /Y %VS_PATH%\%VS_CONF%\%VS_BIN% %~1
IF "%~1" EQU "BUILD" (
ECHO - XBE Patching %VS_PATH%\%VS_CONF%\%VS_BIN%
%XBE_PATCH% %~1\%VS_BIN%
ECHO - Patching Done!
)
ECHO .svn>exclude.txt
ECHO Thumbs.db>>exclude.txt
ECHO Desktop.ini>>exclude.txt
ECHO dsstdfx.bin>>exclude.txt
ECHO exclude.txt>>exclude.txt
xcopy UserData %~1\UserData /E /Q /I /Y /EXCLUDE:exclude.txt
xcopy *.txt %~1 /EXCLUDE:exclude.txt
SET RUN_ME=%~1\run_me.bat
IF "%~1" EQU "BUILD_WIN32" (
ECHO subst q: .>%RUN_ME%
ECHO subst p: q:\userdata >>%RUN_ME%
ECHO subst t: q:\userdata >>%RUN_ME%
ECHO if not exist q:\Temp md Temp >>%RUN_ME%
ECHO subst z: Temp >>%RUN_ME%
ECHO XBMC_PC.exe >>%RUN_ME%
ECHO subst z: /D >>%RUN_ME%
ECHO subst t: /D >>%RUN_ME%
ECHO subst p: /D >>%RUN_ME%
ECHO subst q: /D >>%RUN_ME%
)
cd "skin\Project Mayhem III"
CALL build.bat
cd ..\..
xcopy "skin\Project Mayhem III\BUILD\Project Mayhem III" "%~1\skin\Project Mayhem III" /E /Q /I /Y /EXCLUDE:exclude.txt
cd "skin\PM3.HD"
CALL build.bat
cd ..\..
xcopy "skin\PM3.HD\BUILD\PM3.HD" "%~1\skin\PM3.HD" /E /Q /I /Y /EXCLUDE:exclude.txt
cd "skin\Confluence"
CALL build.bat
cd ..\..
xcopy "skin\Confluence\BUILD\Confluence" "%~1\skin\Confluence" /E /Q /I /Y /EXCLUDE:exclude.txt
cd "skin\Confluence Lite"
CALL build.bat
cd ..\..
xcopy "skin\Confluence Lite\BUILD\Confluence Lite" "%~1\skin\Confluence Lite" /E /Q /I /Y /EXCLUDE:exclude.txt
rem xcopy credits %~1\credits /Q /I /Y /EXCLUDE:exclude.txt
xcopy language %~1\language /E /Q /I /Y /EXCLUDE:exclude.txt
xcopy screensavers %~1\screensavers /E /Q /I /Y /EXCLUDE:exclude.txt
xcopy visualisations %~1\visualisations /E /Q /I /Y /EXCLUDE:exclude.txt
xcopy system %~1\system /E /Q /I /Y /EXCLUDE:exclude.txt
xcopy web\XBMC_Reloaded %~1\web /E /Q /I /Y /EXCLUDE:exclude.txt
xcopy media %~1\media /E /Q /I /Y /EXCLUDE:exclude.txt
xcopy plugins %~1\plugins /E /Q /I /Y /EXCLUDE:exclude.txt
xcopy sounds %~1\sounds /E /Q /I /Y /EXCLUDE:exclude.txt
xcopy scripts %~1\scripts /E /Q /I /Y /EXCLUDE:exclude.txt
del exclude.txt
GOTO:EOF
:COMPRESS
ECHO ------------------------------------------------------------
ECHO Compressing build to XBMC4XBOX.zip file...
ECHO ------------------------------------------------------------
IF EXIST "%COMPRESS%" (
DEL %COMPRESS_FILE%
"%COMPRESS%" %COMPRESS_OPTS% %~1
) ELSE (
ECHO 7-Zip not installed! Skipping compression...
)
ECHO ------------------------------------------------------------
GOTO:EOF
:ERROR
ECHO ------------------------------------------------------------
ECHO !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-
ECHO ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR
ECHO !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-
ECHO ERROR %~1
ECHO ------------------------------------------------------------
GOTO:EOF
:VIEWLOG
SET /P XBMC_BUILD_ANSWER=View the build log in your HTML browser? [y/n]
if /I "%XBMC_BUILD_ANSWER%" EQU "y" (
start /D"%~dp0%VS_PATH%\%VS_CONF%" BuildLog.htm"
)
GOTO:EOF