-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathbuild.bat
More file actions
68 lines (60 loc) · 2.05 KB
/
Copy pathbuild.bat
File metadata and controls
68 lines (60 loc) · 2.05 KB
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
@echo off
setlocal EnableDelayedExpansion
SET games=p2 p1 hl2 ep1 ep2 gmod csgo tf2 asw l4d l4d2 infra mesa p2ce momentum
:: If set, override the FGD filename generated.
SET filename.p2=portal2
SET filename.p1=portal
SET filename.hl2=halflife2
SET filename.ep1=episodic
SET filename.gmod=garrysmod
SET filename.tf2=tf
SET filename.asw=swarm
SET filename.l4d=left4dead
SET filename.l4d2=left4dead2
SET filename.mesa=blackmesa
:: Other games supported by tags, but not currently included in builds
SET filename.dods=dod
SET filename.css=cstrike
SET filename.ez1=EntropyZero
SET filename.ez2=EntropyZero2
SET filename.kz=kreedzclimbing
:: No official name for this, but don't want it to just be "psa.fgd"
SET filename.psa=portal_stillalive
SET filename.asrd=reactivedrop
SET filename.p2sixense=portal2_sixense
:: Officially still just portal2.fgd, but we need it separate
SET filename.p2edu=portal2_edu
SET game=%1
:: Make sure game isn't empty
:while
IF [%game%]==[] (echo Games: %games% & echo Enter game to build. Use ALL to build every game. & SET /P game= & GOTO :while)
IF /I %game%==ALL (
CALL :copy_hammer_files
(FOR %%i in (%games%) do (
CALL :build_game %%i
))
EXIT
) ELSE (
(FOR %%i in (%games%) do (
IF /I %game%==%%i (
CALL :copy_hammer_files
CALL :build_game %game%
EXIT
)
))
echo Unknown game. Exitting. & EXIT /B 1
)
:build_game
SET tag=%1
IF DEFINED filename.%tag% (SET fname=!filename.%tag%!) ELSE (SET fname=%tag%)
echo Building FGD for %1 as "%fname%.fgd"...
python src/hammeraddons/unify_fgd.py exp "%tag%" srctools -o "build/%fname%.fgd"
IF %ERRORLEVEL% NEQ 0 (echo Building FGD for %tag% has failed. Exitting. & EXIT)
EXIT /B
:copy_hammer_files
echo Copying Hammer files...
IF %ERRORLEVEL% LSS 8 robocopy hammer build/hammer /S /PURGE
IF %ERRORLEVEL% LSS 8 robocopy instances build/instances /XF *.vmx /S /PURGE
IF %ERRORLEVEL% LSS 8 robocopy examples build/examples *.vmf readme.md /XF *.vmx *.log *.bsp *.prt /S /PURGE
IF %ERRORLEVEL% LSS 8 EXIT /B 0
echo Failed copying Hammer files. Exitting. & EXIT