Advertisement
Guest User

createprojects.bat

a guest
Nov 16th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.62 KB | None | 0 0
  1. @echo off
  2. title VPC Complete Project File Generator
  3. REM // this gets inputs from the user, then selects the options to goto from them, and continues going back and forth
  4. REM // between the executing whats in the options and selecting the options, until there are no more,
  5. REM // and then it dumps everything into the vpc command line, which you see a preview of it before you run it
  6. :choose
  7. set /p mksln=Create New Solution File? (y or nothing):
  8. if "%mksln%" == "y" (set /p sln_name=Enter a name for the solution file:)
  9.  
  10. set /p compiler=Use win64 compiler? (y or nothing for win32):
  11. REM maybe use the same system for groups for vsversion?
  12. set /p vsversion=Choose a VS version (nothing for 2013):
  13. set /p force=Force Rebuild all projects? (y or nothing):
  14.  
  15. REM Groups
  16. echo Choose groups to build:
  17. echo - nothing for everything
  18. echo - 1 for binary files
  19. echo - 2 for libraries
  20. echo - 3 for gamedlls
  21. echo - 4 for hammer
  22. echo - 5 for shaders
  23. echo - 6 for physics
  24. echo - 7 for tools
  25. echo - 8 for game
  26. echo - or type in 0 to type in a group:
  27. echo -------------------------------------
  28. echo (no spaces allowed, commas not needed)
  29. set /p group="Selections: "
  30.  
  31. REM ==========================================
  32. REM Projects
  33. REM /hl2 /cstrike /dod /hl2mp /episodic /tf /portal /hl1 /lostcoast
  34.  
  35. echo Choose projects to build:
  36. echo - nothing for all default projects
  37. echo - 0 for no projects
  38. echo - 1 for hl2
  39. echo - 2 for hl2mp
  40. echo - 3 for episodic
  41. echo - 4 for lostcoast
  42. echo - or type in P to type in a project:
  43. echo -------------------------------------
  44. echo (no spaces allowed, commas not needed)
  45. set /p project="Selections: "
  46.  
  47. REM ========================================================================================================================
  48.  
  49. :select_mksln
  50. if "%mksln%" == "y" ( goto make_sln
  51. ) else goto dont_make_sln
  52.  
  53. :select_compiler
  54. if "%compiler%" == "y" ( goto win64
  55. ) else goto win32
  56.  
  57. :select_vsversion
  58. if "%vsversion%" == "2015" ( goto 2015
  59. ) else if "%vsversion%" == "2013" ( goto 2013
  60. ) else goto 2013
  61.  
  62. :select_force
  63. if "%force%" == "y" ( goto rebuild
  64. ) else goto dont_rebuild
  65.  
  66. REM ============================================================
  67. REM groups
  68.  
  69. :select_group_everything
  70. REM checks if the variable is empty
  71. if [%group%] == [] (set grp_all=+everything & goto select_project_default
  72. ) else goto select_group_0
  73.  
  74. :select_group_0
  75. REM this searches for the character 0 in %group%, and goes to group_custom if it finds it, else it goes to select_group_1
  76. (echo %group% | findstr /i /c:"0" >nul) && (goto group_add) || (goto select_group_1)
  77.  
  78. :select_group_1
  79. REM this searches for the character 1 in %group%, and goes to group_1 if it finds it, else it goes to select_group_2
  80. (echo %group% | findstr /i /c:"1" >nul) && (goto group_1) || (goto select_group_2)
  81.  
  82. :select_group_2
  83. (echo %group% | findstr /i /c:"2" >nul) && (goto group_2) || (goto select_group_3)
  84.  
  85. :select_group_3
  86. (echo %group% | findstr /i /c:"3" >nul) && (goto group_3) || (goto select_group_4)
  87.  
  88. :select_group_4
  89. (echo %group% | findstr /i /c:"4" >nul) && (goto group_4) || (goto select_group_5)
  90.  
  91. :select_group_5
  92. (echo %group% | findstr /i /c:"5" >nul) && (goto group_5) || (goto select_group_6)
  93.  
  94. :select_group_6
  95. (echo %group% | findstr /i /c:"6" >nul) && (goto group_6) || (goto select_group_7)
  96.  
  97. :select_group_7
  98. (echo %group% | findstr /i /c:"7" >nul) && (goto group_7) || (goto select_group_8)
  99.  
  100. :select_group_8
  101. (echo %group% | findstr /i /c:"8" >nul) && (goto group_8) || (goto select_project_default)
  102.  
  103. REM ============================================================
  104. REM projects
  105.  
  106. :select_project_default
  107. REM this is for default projects
  108. if [%project%] == [] (set proj_all=/hl2 /hl2mp /episodic /lostcoast & goto createprojects
  109. ) else goto select_project_add
  110.  
  111. :select_project_add
  112. REM this is for adding custom projects
  113. (echo %project% | findstr /i /c:"P" >nul) && (goto project_add) || (goto select_project_0)
  114.  
  115. :select_project_0
  116. REM this is for no projects
  117. (echo %project% | findstr /i /c:"0" >nul) && (goto project_0) || (goto select_project_1)
  118.  
  119. :select_project_1
  120. (echo %project% | findstr /i /c:"1" >nul) && (goto project_1) || (goto select_project_2)
  121.  
  122. :select_project_2
  123. (echo %project% | findstr /i /c:"2" >nul) && (goto project_2) || (goto select_project_3)
  124.  
  125. :select_project_3
  126. (echo %project% | findstr /i /c:"3" >nul) && (goto project_3) || (goto select_project_4)
  127.  
  128. :select_project_4
  129. (echo %project% | findstr /i /c:"4" >nul) && (goto project_4) || (goto createprojects)
  130.  
  131. REM ========================================================================================================================
  132. REM ========================================================================================================================
  133.  
  134. REM ==============================
  135. REM Solution File
  136. :make_sln
  137. set mksln=/mksln
  138. goto select_compiler
  139.  
  140. :dont_make_sln
  141. set mksln=
  142. goto select_compiler
  143.  
  144. REM ==============================
  145. REM Compilers
  146. :win32
  147. set compiler=
  148. goto select_vsversion
  149.  
  150. :win64
  151. set compiler=/define:WIN64
  152. goto select_vsversion
  153.  
  154. REM ==============================
  155. REM VS versions
  156. :2013
  157. set vsversion=/2013
  158. goto select_force
  159.  
  160. :2015
  161. set vsversion=/define:2015
  162. goto select_force
  163.  
  164. REM ==============================
  165. REM Force Rebuild Projects
  166. :rebuild
  167. set force=/f
  168. goto select_group_everything
  169.  
  170. :dont_rebuild
  171. set force=
  172. goto select_group_everything
  173.  
  174. REM ==============================
  175. REM Groups
  176.  
  177. :group_add
  178. echo ------------------------------
  179. echo Enter project groups you want
  180. echo make sure each group looks like this: +example
  181. echo and space each word out
  182.  
  183. set /p grp_add=Groups:
  184. echo ------------------------------
  185. goto select_group_1
  186.  
  187. :group_1
  188. set grp_01=+bin
  189. goto select_group_2
  190.  
  191. :group_2
  192. set grp_02=+libraries
  193. goto select_group_3
  194.  
  195. :group_3
  196. set grp_03=+gamedlls
  197. goto select_group_4
  198.  
  199. :group_4
  200. set grp_04=+hammer
  201. goto select_group_5
  202.  
  203. :group_5
  204. set grp_05=+shaders
  205. goto select_group_6
  206.  
  207. :group_6
  208. set grp_06=+physics
  209. goto select_group_7
  210.  
  211. :group_7
  212. set grp_07=+tools
  213. goto select_group_8
  214.  
  215. :group_8
  216. set grp_08=+game
  217. goto createprojects
  218.  
  219. REM idk what im doing at this point
  220. REM :group_combine
  221. REM set groups="%grp_all% %grp_custom% %grp_01% %grp_02% %grp_03% %grp_04% %grp_05% %grp_06% %grp_07% %grp_08%"
  222.  
  223. REM ==========================================================================================
  224. REM Projects
  225.  
  226. :project_add
  227. echo ------------------------------
  228. echo Enter projects you want
  229. echo make sure each project looks like this: /example
  230. echo and space each word out
  231.  
  232. set /p proj_add=Projects:
  233. echo ------------------------------
  234. goto select_project_1
  235.  
  236. :project_0
  237. set proj_default="/hl2 /hl2mp /episodic /lostcoast"
  238.  
  239. :project_1
  240. set proj_01=/hl2
  241. goto select_project_2
  242.  
  243. :project_2
  244. set proj_02=/hl2mp
  245. goto select_project_3
  246.  
  247. :project_3
  248. set proj_03=/episodic
  249. goto select_project_4
  250.  
  251. :project_4
  252. set proj_04=/lostcoast
  253. goto createprojects
  254.  
  255.  
  256. :createprojects
  257. echo =============================================
  258. echo Current VPC command line:
  259. echo %grp_all% %grp_add% %grp_01% %grp_02% %grp_03% %grp_04% %grp_05% %grp_06% %grp_07% %grp_08% %force% %proj_default% %proj_all% %proj_add% %proj_01% %proj_02% %proj_03% %proj_04% %mksln% "%sln_name%" %vsversion% %compiler%
  260. pause
  261. echo =============================================
  262. REM can i merge all the groups into one variable? %groups%? maybe with projects as well?
  263. devtools\bin\vpc %grp_all% %grp_add% %grp_01% %grp_02% %grp_03% %grp_04% %grp_05% %grp_06% %grp_07% %grp_08% %force% %proj_default% %proj_all% %proj_add% %proj_01% %proj_02% %proj_03% %proj_04% %mksln% "%sln_name%" %vsversion% %compiler%
  264. pause
  265. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement