master_winamp.cmd 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. @echo off
  2. if %1()==() goto help
  3. if %1==BETA goto start
  4. if %1==QA goto start
  5. if %1==FINAL goto start
  6. if %1==NIGHT goto start
  7. goto end
  8. :start
  9. echo Configuring Kerberos...
  10. call "d:\kerblogin\kerblogin.cmd"
  11. if %1==QA SET BUILDTYPE=qa
  12. if %1==BETA SET BUILDTYPE=beta
  13. if %1==FINAL SET BUILDTYPE=final
  14. if %1==NIGHT SET BUILDTYPE=night
  15. echo Setting VC 9.0 environments...
  16. call "C:\Program Files\Intel\IPP\6.1.3.047\ia32\tools\env\ippenv.bat"
  17. call %DXSDK_DIR%\Utilities\Bin\dx_setenv.cmd x86
  18. REM call "D:\SDKs\Windows\v7.0\Bin\SetEnv.cmd" /XP /Release
  19. call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
  20. if NOT %1==FINAL set LINK=%LINK% /DEBUG
  21. set CL=%CL% /D_CRT_SECURE_NO_WARNINGS
  22. set PATH=%path%;C:\program files\nsis\unicode
  23. SET TARGET_ARCH=x86
  24. if %3()==() goto skip64
  25. if %3==x86 goto skip64
  26. SET TARGET_ARCH=x64
  27. call "D:\SDKs\Windows\v7.0\Bin\setenv.cmd" /x64 /release
  28. call "d:\dxsdk\dx_setenv.cmd" AMD64
  29. set CL=%CL% /GS- /I "d:\dxsdk\Include"
  30. set LINK=%LINK% /machine:AMD64
  31. goto skip32
  32. :skip64
  33. REM call "D:\SDKs\Windows\v7.0\Bin\SetEnv.cmd" /XP /Release
  34. :skip32
  35. title Nullsoft Winamp build script -= %1 =-
  36. if NOT %2()==() SET BRANDING=%2
  37. if NOT DEFINED BRANDING SET BRANDING=NULLSOFT
  38. echo BRANDING=%BRANDING%
  39. echo Preparing folders...
  40. if exist ts.txt del ts.txt
  41. nstimestamp\nstimestamp>ts.txt
  42. set /p TIMESTAMP=<ts.txt
  43. del ts.txt
  44. f:
  45. cd \
  46. set SANDBOX=f:\sandbox
  47. set CURSANDBOX=%SANDBOX%\%TIMESTAMP%
  48. echo Using %CURSANDBOX% for Sandbox
  49. set PROGRAMFILES=%CURSANDBOX%\Output
  50. set ROOTDIR=%CURSANDBOX%
  51. if NOT exist "%SANDBOX%" mkdir "%SANDBOX%"
  52. if errorlevel 1 goto SANDBOX_ERROR
  53. if exist "%CURSANDBOX%" rd /s /q "%CURSANDBOX%"
  54. mkdir "%CURSANDBOX%"
  55. if errorlevel 1 goto SANDBOX_ERROR
  56. if exist "%PROGRAMFILES%" rd /s /q "%PROGRAMFILES%"
  57. mkdir "%PROGRAMFILES%"
  58. if errorlevel 1 goto SANDBOX_ERROR
  59. SET INSTALLER_LANG=Mastering\Winamp\installer_%BUILDTYPE%.lang
  60. SET INSTALLER_CONFIG=Mastering\Winamp\installer_%BUILDTYPE%.config
  61. echo Retrieving mastering scripts from cvs...
  62. if "%TARGET_ARCH%"=="x64" goto master64
  63. echo using x86 mastering script
  64. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\master_winamp_%BUILDTYPE%.xml" >nul
  65. if errorlevel 1 goto CVS_ERROR_1
  66. goto master86
  67. :master64
  68. echo using x64 mastering script
  69. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\master_winamp_%BUILDTYPE%_x64.xml" >nul
  70. if errorlevel 1 goto CVS_ERROR_1
  71. :master86
  72. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\build_winamp_%BUILDTYPE%.xml" >nul
  73. if errorlevel 1 goto CVS_ERROR_2
  74. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\configmap.xml" >nul
  75. if errorlevel 1 goto CVS_ERROR_3
  76. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\version_%BUILDTYPE%.info" >nul
  77. if errorlevel 1 goto CVS_ERROR_4
  78. cvs checkout -N -d "%CURSANDBOX%" "Mastering\VerCtrl\verctrl.exe" >nul
  79. if errorlevel 1 goto CVS_ERROR_5
  80. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\constants.h" >nul
  81. if errorlevel 1 goto CVS_ERROR_6
  82. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\buildnumber.h" >nul
  83. if errorlevel 1 goto CVS_ERROR_7
  84. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\talkback.ini" >nul
  85. if errorlevel 1 goto CVS_ERROR_7
  86. if NOT %1==NIGHT cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\set_tags_%BUILDTYPE%.cmd" >nul
  87. if errorlevel 1 goto CVS_ERROR_8
  88. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\fileNames.cmd" >nul
  89. if errorlevel 1 goto CVS_ERROR_9
  90. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\build_installer.cmd" >nul
  91. if errorlevel 1 goto CVS_ERROR_10
  92. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\build_wbm.cmd" >nul
  93. if errorlevel 1 goto CVS_ERROR_10
  94. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\rebase.cmd" >nul
  95. if errorlevel 1 goto CVS_ERROR_10
  96. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\build_webdev.cmd" >nul
  97. if errorlevel 1 goto CVS_ERROR_10
  98. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\build_orb.cmd" >nul
  99. if errorlevel 1 goto CVS_ERROR_10
  100. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\build_wadetect.cmd" >nul
  101. if errorlevel 1 goto CVS_ERROR_10
  102. cvs checkout -N -d "%CURSANDBOX%" "%INSTALLER_LANG%" >nul
  103. if errorlevel 1 goto CVS_ERROR_11
  104. cvs checkout -N -d "%CURSANDBOX%" "%INSTALLER_CONFIG%" >nul
  105. if errorlevel 1 goto CVS_ERROR_12
  106. cvs checkout -N -d "%CURSANDBOX%" "codesign\signcode-pwd.exe" >nul
  107. cvs checkout -N -d "%CURSANDBOX%" "Mastering\Winamp\simple_sign.cmd" >nul
  108. f:
  109. cd \
  110. echo Patching version number...
  111. cd "%CURSANDBOX%\Mastering\Winamp"
  112. copy "version_%BUILDTYPE%.info" "version.info"
  113. for /f "tokens=1-3" %%a in (version.info) do set %%a%%b%%c
  114. cd "%CURSANDBOX%\Mastering\VerCtrl"
  115. verctrl.exe %1 %BRANDING% INC > nul
  116. SET ERRORLEVEL=0
  117. cd "%CURSANDBOX%\Mastering\Winamp"
  118. cvs commit -m"version patch" "constants.h" > nul
  119. if errorlevel 1 goto CVS_ERROR_COMMIT
  120. if NOT %1==NIGHT echo Setting Tags...
  121. if NOT %1==NIGHT call "%CURSANDBOX%\Mastering\Winamp\set_tags_%BUILDTYPE%.cmd"
  122. if errorlevel 1 goto SET_TAGS_ERROR
  123. SET GIT_ASK_YESNO=false
  124. git clone -b "%REPLICANT_GIT_BRANCH%" ssh://[email protected]/nullsoft/replicant.git "%CURSANDBOX%\replicant"
  125. if errorlevel 1 goto GIT_ERROR
  126. echo Setting Installer names...
  127. call "%CURSANDBOX%\Mastering\Winamp\fileNames.cmd"
  128. if errorlevel 1 goto SET_FILENAMES
  129. if %1==QA echo Starting mastering script (build type: QA)
  130. if %1==BETA echo Starting mastering script (build type: BETA)...
  131. if %1==NIGHT echo Starting mastering script (build type: NIGHT)...
  132. if %1==FINAL echo Starting mastering script (build type: FINAL)...
  133. if "%TARGET_ARCH%"=="x64" goto build64
  134. perl -S dgbuild.pl master_winamp_%BUILDTYPE%.xml > nul
  135. goto build86
  136. :build64
  137. perl -S dgbuild.pl master_winamp_%BUILDTYPE%_x64.xml > nul
  138. :build86
  139. if errorlevel 1 goto BUILD_ERROR
  140. echo Build done. Check http://nulldev.stream.aol.com/builds/default.asp for result.
  141. goto END
  142. :SANDBOX_ERROR
  143. echo Error!!! Unable to prepare folder '%CURSANDBOX%'
  144. goto END
  145. :OUTPUT_ERROR
  146. echo Error!!! Unable to prepare folder '%PROGRAMFILES%'
  147. goto END
  148. :CVS_ERROR_LOGIN
  149. echo Error!!! Unable to login into the cvs
  150. goto END
  151. :CVS_ERROR_1
  152. echo Error!!! Unable to checkout 'Mastering/Winamp/master_winamp.xml'
  153. goto END
  154. :CVS_ERROR_2
  155. echo Error!!! Unable to checkout 'Mastering/Winamp/build_winamp.xml'
  156. goto END
  157. :CVS_ERROR_3
  158. echo Error!!! Unable to checkout 'Mastering/Winamp/configmap.xml'
  159. goto END
  160. :CVS_ERROR_4
  161. echo Error!!! Unable to checkout 'Mastering/Winamp/version.info'
  162. goto END
  163. :CVS_ERROR_5
  164. echo Error!!! Unable to checkout 'Mastering/Winamp/verctrl.exe'
  165. goto END
  166. :CVS_ERROR_6
  167. echo Error!!! Unable to checkout 'Mastering/Winamp/constants.h'
  168. goto END
  169. :CVS_ERROR_7
  170. echo Error!!! Unable to checkout 'Mastering/Winamp/buildnumber.h'
  171. goto END
  172. :CVS_ERROR_8
  173. echo Error!!! Unable to checkout 'Mastering/Winamp/set_tags_%BUILDTYPE%.cmd'
  174. goto END
  175. :CVS_ERROR_9
  176. echo Error!!! Unable to checkout 'Mastering/Winamp/fileNames.cmd'
  177. goto END
  178. :CVS_ERROR_10
  179. echo Error!!! Unable to checkout 'Mastering/Winamp/build_installer.cmd'
  180. goto END
  181. :CVS_ERROR_11
  182. echo Error!!! Unable to checkout 'Mastering/Winamp/%INSTALLER_LANG%'
  183. goto END
  184. :CVS_ERROR_12
  185. echo Error!!! Unable to checkout 'Mastering/Winamp/%INSTALLER_CONFIG%'
  186. goto END
  187. :CVS_ERROR_COMMIT
  188. echo Error!!! Unable to commit 'Mastering/Winamp/constants.h'
  189. goto END
  190. :SET_TAGS_ERROR
  191. echo Error!!! Unable to set tags.
  192. goto END
  193. :SET_FILENAMES
  194. echo Error!!! Unable to set installer file names.
  195. goto END
  196. :BUILD_ERROR
  197. echo Error!!! Build error.
  198. goto END
  199. :help
  200. echo Specify build type (BETA, NIGHT, FINAL, QA)
  201. goto end
  202. :GIT_ERROR
  203. echo Error!!! Unable to clone git repository
  204. goto END
  205. :END
  206. exit