Skip to content

Commit

Permalink
feat(p2ce): Add postcompiler patch file
Browse files Browse the repository at this point in the history
  • Loading branch information
ozxybox committed Nov 7, 2024
1 parent c0e1def commit bc3e47f
Show file tree
Hide file tree
Showing 4 changed files with 1,487 additions and 23 deletions.
22 changes: 3 additions & 19 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ IF /I %game%==ALL (

:build_fgd_p2ce
CALL :copy_hammer_files p2ce
CALL :copy_vscript_files
CALL :copy_postcompiler_files
CALL :build_game_fgd p2ce
CALL :build_game_fgd p2ce srctools --extra patch_postcompiler.fgd
EXIT /B

:build_fgd_momentum
Expand All @@ -99,15 +97,15 @@ IF /I %game%==ALL (
:build_game_fgd
echo Building FGD for %1...
mkdir "%build_dir%/%1"
python unify_fgd.py exp %1 srctools -o "%build_dir%/%1/%1.fgd"
python unify_fgd.py %3 %4 exp %1 %2 -o "%build_dir%/%1/%1.fgd"

IF %ERRORLEVEL% NEQ 0 (echo Building FGD for %1 has failed. Exitting. & EXIT)
EXIT /B

:build_game_markdown
echo Generating markdown from FGD for %1...
mkdir "%build_md_dir%/%1"
python unify_fgd.py expmd %1 srctools -o "%build_md_dir%/%1"
python unify_fgd.py expmd %1 -o "%build_md_dir%/%1"

IF %ERRORLEVEL% NEQ 0 (echo Building markdown for %1 has failed. Exitting. & EXIT)
EXIT /B
Expand All @@ -119,17 +117,3 @@ IF /I %game%==ALL (

IF %ERRORLEVEL% LSS 8 EXIT /B 0
echo Failed copying Hammer files for %1. Exitting. & EXIT

:copy_vscript_files
echo Copying VScript files (hammer/scripts)...
robocopy hammer/scripts %build_dir%/hammer/scripts /S /PURGE

IF %ERRORLEVEL% LSS 8 EXIT /B 0
echo Failed copying VScript files (hammer/scripts). Exitting. & EXIT

:copy_postcompiler_files
echo Copying postcompiler transforms...
robocopy transforms %build_dir%/%bin_dir%/postcompiler/transforms /S /PURGE

IF %ERRORLEVEL% LSS 8 EXIT /B 0
echo Failed copying postcompiler transforms. Exitting. & EXIT
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ build() {

build_fgd_p2ce() {
copy_hammer_files p2ce
build_game_fgd p2ce
build_game_fgd p2ce srctools --extra patch_postcompiler.fgd
}

build_fgd_momentum() {
Expand All @@ -58,7 +58,7 @@ build_fgd_momentum() {
build_game_markdown() {
echo "Generating markdown from FGD for $1..."
mkdir -p "$build_md_dir/$1"
python3 unify_fgd.py expmd $1 srctools -o "$build_md_dir/$1"
python3 unify_fgd.py expmd $1 -o "$build_md_dir/$1"

if [ $? -ne 0 ]; then
echo "Building markdown for $1 has failed. Exitting." && exit 1
Expand All @@ -81,7 +81,7 @@ copy_hammer_files() {
build_game_fgd() {
echo "Building FGD for $1..."
mkdir -p "$build_dir/$1"
python3 unify_fgd.py exp $1 srctools -o "$build_dir/$1/$1.fgd"
python3 unify_fgd.py $3 $4 exp $1 $2 -o "$build_dir/$1/$1.fgd"

if [ $? -ne 0 ]; then
echo "Building FGD for $1 has failed. Exitting." && exit 1
Expand Down
Loading

0 comments on commit bc3e47f

Please sign in to comment.