summaryrefslogtreecommitdiff
path: root/devtools/mapbuild/buildmod.bat
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /devtools/mapbuild/buildmod.bat
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'devtools/mapbuild/buildmod.bat')
-rw-r--r--devtools/mapbuild/buildmod.bat74
1 files changed, 74 insertions, 0 deletions
diff --git a/devtools/mapbuild/buildmod.bat b/devtools/mapbuild/buildmod.bat
new file mode 100644
index 0000000..ef6b4f0
--- /dev/null
+++ b/devtools/mapbuild/buildmod.bat
@@ -0,0 +1,74 @@
+echo off
+
+if "%1" == "" goto usage
+
+@rem **********************************************************************
+@REM If the mapbuild directory ever moves out of src\devools,
+@REM update this relative path to the tree's "main" directory.
+@rem **********************************************************************
+set maindir=..\..\..
+
+if not exist %maindir%\game\%1 goto usage
+
+set vproject=%maindir%\game\%1
+
+@rem **********************************************************************
+@rem build options are -reslist, -nodegraph, -bsp, and -forcebuild.
+@rem The "-forcebuild" flag is used to build all changed maps, even if they
+@rem didn't use the 'autocompile' keyword. This is currently being used
+@rem to build only reslists and nodegraphs of changed maps each night.
+@rem **********************************************************************
+
+set defaultflags=%2
+set buildflags=%defaultflags%
+
+set TIME=
+for /F "tokens=1-4 delims=:., " %%a in ("%TIME%") do set TIME=%%a%%b%%c
+@rem if %TIME% GTR 030000 set buildflags="-forcebuild -reslist -nodegraph"
+@rem if %TIME% GTR 060000 set buildflags=%defaultflags%
+
+@rem **********************************************************************
+@rem Generate a list of changed vmf's without actually syncing them
+@rem **********************************************************************
+
+p4 sync -n %maindir%\content\%1\maps\*.vmf >> %1_buildlist.txt
+
+@rem **********************************************************************
+@rem Sync specified vmf's only. If "-forcebuild" flag is set,
+@rem all changed vmf's will be synced. Otherwise, only maps
+@rem that had the "autocompile" keyword in the checkin comments
+@rem will be synced.
+@rem **********************************************************************
+
+syncChangedMaps.pl %1 %buildflags%
+
+if errorlevel 1 goto end
+
+@rem **********************************************************************
+@rem Sync all other files
+@rem **********************************************************************
+
+p4 sync %maindir%\game\...
+p4 sync %maindir%\src\...
+
+@rem **********************************************************************
+@rem Build bsp's, cubemaps, and checkin
+@rem **********************************************************************
+
+echo compiling %1 maps >> log.txt
+time /t >> log.txt
+
+buildMaps.pl -mod %1 -maindir %maindir% %buildflags% %2
+
+echo Finished %1 >> log.txt
+time /t >> log.txt
+echo. >> log.txt
+echo. >> log.txt
+
+goto end
+
+:usage
+echo Usage: buildmod [modname]
+
+:end
+echo > %1_buildlist.txt