Extract pre and post build scripts
- Extracted pre-build and post-build scripts to tools\ - Updated the pre-build script to overwrite git.h only if commit hash has changed - Improved post build scripts error handling and debugging symbols support
This commit is contained in:
parent
ad0db92a90
commit
28d96b104e
@ -5,5 +5,6 @@
|
|||||||
<GTA2_EXE>gta2.exe</GTA2_EXE>
|
<GTA2_EXE>gta2.exe</GTA2_EXE>
|
||||||
<GTA2_ASI_DIR>$(GTA2_DIR)\scripts</GTA2_ASI_DIR>
|
<GTA2_ASI_DIR>$(GTA2_DIR)\scripts</GTA2_ASI_DIR>
|
||||||
<GTA2_ASI_FILENAME>gta2-seuko-mod.asi</GTA2_ASI_FILENAME>
|
<GTA2_ASI_FILENAME>gta2-seuko-mod.asi</GTA2_ASI_FILENAME>
|
||||||
|
<GTA2_ASI_PDB_FILENAME>gta2-seuko-mod.pdb</GTA2_ASI_PDB_FILENAME>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -127,62 +127,10 @@
|
|||||||
<ModuleDefinitionFile>src\dinput8.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>src\dinput8.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>@echo off
|
<Command>call "$(ProjectDir)tools\post-build-dinput8.bat" "$(GTA2_DIR)" "$(GTA2_EXE)" "$(TargetPath)" "$(TargetDir)" "$(TargetName)"</Command>
|
||||||
|
|
||||||
echo Dinput8 proxy mode enabled
|
|
||||||
|
|
||||||
if "$(GTA2_DIR)"=="" (
|
|
||||||
echo ERROR: GTA2_DIR is not set. Make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if "$(GTA2_EXE)"=="" (
|
|
||||||
echo ERROR: GTA2_EXE is not set. Make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if not exist "$(GTA2_DIR)\" (
|
|
||||||
echo ERROR: GTA2_DIR "$(GTA2_DIR)" specified in GTA2.props does not exist.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if not exist "$(GTA2_DIR)\$(GTA2_EXE)" (
|
|
||||||
echo ERROR: "$(GTA2_EXE)" not found in "$(GTA2_DIR)". Check GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
echo Copying "$(TargetPath)" to "$(GTA2_DIR)"
|
|
||||||
|
|
||||||
copy /Y "$(TargetPath)" "$(GTA2_DIR)\"
|
|
||||||
if errorlevel 1 exit /b 1
|
|
||||||
|
|
||||||
if exist "$(TargetDir)$(TargetName).pdb" (
|
|
||||||
copy /Y "$(TargetDir)$(TargetName).pdb" "$(GTA2_DIR)\"
|
|
||||||
)
|
|
||||||
|
|
||||||
exit /b 0
|
|
||||||
</Command>
|
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>set GIT_HASH=unknown
|
<Command>call "$(ProjectDir)tools\update-git-header.bat" "$(ProjectDir)"</Command>
|
||||||
set GIT_DIRTY=false
|
|
||||||
|
|
||||||
for /f %%i in ('git rev-parse --short HEAD 2^>nul') do set GIT_HASH=%%i
|
|
||||||
|
|
||||||
for /f %%i in ('git status --porcelain 2^>nul') do (
|
|
||||||
set GIT_DIRTY=true
|
|
||||||
goto :dirty_done
|
|
||||||
)
|
|
||||||
:dirty_done
|
|
||||||
|
|
||||||
echo #pragma once> "$(ProjectDir)src\git.h"
|
|
||||||
echo // Auto-generated. Do not edit.>> "$(ProjectDir)src\git.h"
|
|
||||||
echo.>> "$(ProjectDir)src\git.h"
|
|
||||||
echo #define GIT_COMMIT_HASH "%GIT_HASH%">> "$(ProjectDir)src\git.h"
|
|
||||||
echo #define GIT_IS_DIRTY %GIT_DIRTY%>> "$(ProjectDir)src\git.h"
|
|
||||||
|
|
||||||
echo Created $(ProjectDir)src\git.h with commit %GIT_HASH% (dirty=%GIT_DIRTY%)
|
|
||||||
</Command>
|
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAsi|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAsi|Win32'">
|
||||||
@ -209,73 +157,10 @@ echo Created $(ProjectDir)src\git.h with commit %GIT_HASH% (dirty=%GIT_DIRTY%)
|
|||||||
</ModuleDefinitionFile>
|
</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>@echo off
|
<Command>call "$(ProjectDir)tools\post-build-asi.bat" "$(GTA2_DIR)" "$(GTA2_EXE)" "$(GTA2_ASI_DIR)" "$(GTA2_ASI_FILENAME)" "$(GTA2_ASI_PDB_FILENAME)" "$(TargetPath)" "$(TargetDir)" "$(TargetName)"</Command>
|
||||||
|
|
||||||
echo ASI mode enabled
|
|
||||||
|
|
||||||
if "$(GTA2_DIR)"=="" (
|
|
||||||
echo ERROR: GTA2_DIR is not set. Make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if "$(GTA2_EXE)"=="" (
|
|
||||||
echo ERROR: GTA2_EXE is not set. Make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if not exist "$(GTA2_DIR)\" (
|
|
||||||
echo ERROR: GTA2_DIR "$(GTA2_DIR)" specified in GTA2.props does not exist.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if not exist "$(GTA2_DIR)\$(GTA2_EXE)" (
|
|
||||||
echo ERROR: "$(GTA2_EXE)" not found in "$(GTA2_DIR)". Check GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if "$(GTA2_ASI_DIR)"=="" (
|
|
||||||
echo ERROR: GTA2_ASI_DIR is not set. To build in ASI mode, make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if "$(GTA2_ASI_FILENAME)"=="" (
|
|
||||||
echo ERROR: GTA2_ASI_FILENAME is not set. To build in ASI mode, make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if not exist "$(GTA2_ASI_DIR)\" (
|
|
||||||
echo ERROR: GTA2_ASI_DIR "$(GTA2_ASI_DIR)" does not exist. Check GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
echo Copying "$(TargetPath)" to "$(GTA2_ASI_DIR)\$(GTA2_ASI_FILENAME)"
|
|
||||||
|
|
||||||
copy /Y "$(TargetPath)" "$(GTA2_ASI_DIR)\$(GTA2_ASI_FILENAME)"
|
|
||||||
if errorlevel 1 exit /b 1
|
|
||||||
|
|
||||||
exit /b 0
|
|
||||||
</Command>
|
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>set GIT_HASH=unknown
|
<Command>call "$(ProjectDir)tools\update-git-header.bat" "$(ProjectDir)"</Command>
|
||||||
set GIT_DIRTY=false
|
|
||||||
|
|
||||||
for /f %%i in ('git rev-parse --short HEAD 2^>nul') do set GIT_HASH=%%i
|
|
||||||
|
|
||||||
for /f %%i in ('git status --porcelain 2^>nul') do (
|
|
||||||
set GIT_DIRTY=true
|
|
||||||
goto :dirty_done
|
|
||||||
)
|
|
||||||
:dirty_done
|
|
||||||
|
|
||||||
echo #pragma once> "$(ProjectDir)src\git.h"
|
|
||||||
echo // Auto-generated. Do not edit.>> "$(ProjectDir)src\git.h"
|
|
||||||
echo.>> "$(ProjectDir)src\git.h"
|
|
||||||
echo #define GIT_COMMIT_HASH "%GIT_HASH%">> "$(ProjectDir)src\git.h"
|
|
||||||
echo #define GIT_IS_DIRTY %GIT_DIRTY%>> "$(ProjectDir)src\git.h"
|
|
||||||
|
|
||||||
echo Created $(ProjectDir)src\git.h with commit %GIT_HASH% (dirty=%GIT_DIRTY%)
|
|
||||||
</Command>
|
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
@ -303,62 +188,10 @@ echo Created $(ProjectDir)src\git.h with commit %GIT_HASH% (dirty=%GIT_DIRTY%)
|
|||||||
<ModuleDefinitionFile>src\dinput8.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>src\dinput8.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>@echo off
|
<Command>call "$(ProjectDir)tools\post-build-dinput8.bat" "$(GTA2_DIR)" "$(GTA2_EXE)" "$(TargetPath)" "$(TargetDir)" "$(TargetName)"</Command>
|
||||||
|
|
||||||
echo Dinput8 proxy mode enabled
|
|
||||||
|
|
||||||
if "$(GTA2_DIR)"=="" (
|
|
||||||
echo ERROR: GTA2_DIR is not set. Make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if "$(GTA2_EXE)"=="" (
|
|
||||||
echo ERROR: GTA2_EXE is not set. Make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if not exist "$(GTA2_DIR)\" (
|
|
||||||
echo ERROR: GTA2_DIR "$(GTA2_DIR)" specified in GTA2.props does not exist.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if not exist "$(GTA2_DIR)\$(GTA2_EXE)" (
|
|
||||||
echo ERROR: "$(GTA2_EXE)" not found in "$(GTA2_DIR)". Check GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
echo Copying "$(TargetPath)" to "$(GTA2_DIR)"
|
|
||||||
|
|
||||||
copy /Y "$(TargetPath)" "$(GTA2_DIR)\"
|
|
||||||
if errorlevel 1 exit /b 1
|
|
||||||
|
|
||||||
if exist "$(TargetDir)$(TargetName).pdb" (
|
|
||||||
copy /Y "$(TargetDir)$(TargetName).pdb" "$(GTA2_DIR)\"
|
|
||||||
)
|
|
||||||
|
|
||||||
exit /b 0
|
|
||||||
</Command>
|
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>set GIT_HASH=unknown
|
<Command>call "$(ProjectDir)tools\update-git-header.bat" "$(ProjectDir)"</Command>
|
||||||
set GIT_DIRTY=false
|
|
||||||
|
|
||||||
for /f %%i in ('git rev-parse --short HEAD 2^>nul') do set GIT_HASH=%%i
|
|
||||||
|
|
||||||
for /f %%i in ('git status --porcelain 2^>nul') do (
|
|
||||||
set GIT_DIRTY=true
|
|
||||||
goto :dirty_done
|
|
||||||
)
|
|
||||||
:dirty_done
|
|
||||||
|
|
||||||
echo #pragma once> "$(ProjectDir)src\git.h"
|
|
||||||
echo // Auto-generated. Do not edit.>> "$(ProjectDir)src\git.h"
|
|
||||||
echo.>> "$(ProjectDir)src\git.h"
|
|
||||||
echo #define GIT_COMMIT_HASH "%GIT_HASH%">> "$(ProjectDir)src\git.h"
|
|
||||||
echo #define GIT_IS_DIRTY %GIT_DIRTY%>> "$(ProjectDir)src\git.h"
|
|
||||||
|
|
||||||
echo Created $(ProjectDir)src\git.h with commit %GIT_HASH% (dirty=%GIT_DIRTY%)
|
|
||||||
</Command>
|
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAsi|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAsi|Win32'">
|
||||||
@ -388,73 +221,10 @@ echo Created $(ProjectDir)src\git.h with commit %GIT_HASH% (dirty=%GIT_DIRTY%)
|
|||||||
</ModuleDefinitionFile>
|
</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>@echo off
|
<Command>call "$(ProjectDir)tools\post-build-asi.bat" "$(GTA2_DIR)" "$(GTA2_EXE)" "$(GTA2_ASI_DIR)" "$(GTA2_ASI_FILENAME)" "$(GTA2_ASI_PDB_FILENAME)" "$(TargetPath)" "$(TargetDir)" "$(TargetName)"</Command>
|
||||||
|
|
||||||
echo ASI mode enabled
|
|
||||||
|
|
||||||
if "$(GTA2_DIR)"=="" (
|
|
||||||
echo ERROR: GTA2_DIR is not set. Make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if "$(GTA2_EXE)"=="" (
|
|
||||||
echo ERROR: GTA2_EXE is not set. Make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if not exist "$(GTA2_DIR)\" (
|
|
||||||
echo ERROR: GTA2_DIR "$(GTA2_DIR)" specified in GTA2.props does not exist.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if not exist "$(GTA2_DIR)\$(GTA2_EXE)" (
|
|
||||||
echo ERROR: "$(GTA2_EXE)" not found in "$(GTA2_DIR)". Check GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if "$(GTA2_ASI_DIR)"=="" (
|
|
||||||
echo ERROR: GTA2_ASI_DIR is not set. To build in ASI mode, make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if "$(GTA2_ASI_FILENAME)"=="" (
|
|
||||||
echo ERROR: GTA2_ASI_FILENAME is not set. To build in ASI mode, make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if not exist "$(GTA2_ASI_DIR)\" (
|
|
||||||
echo ERROR: GTA2_ASI_DIR "$(GTA2_ASI_DIR)" does not exist. Check GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
echo Copying "$(TargetPath)" to "$(GTA2_ASI_DIR)\$(GTA2_ASI_FILENAME)"
|
|
||||||
|
|
||||||
copy /Y "$(TargetPath)" "$(GTA2_ASI_DIR)\$(GTA2_ASI_FILENAME)"
|
|
||||||
if errorlevel 1 exit /b 1
|
|
||||||
|
|
||||||
exit /b 0
|
|
||||||
</Command>
|
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>set GIT_HASH=unknown
|
<Command>call "$(ProjectDir)tools\update-git-header.bat" "$(ProjectDir)"</Command>
|
||||||
set GIT_DIRTY=false
|
|
||||||
|
|
||||||
for /f %%i in ('git rev-parse --short HEAD 2^>nul') do set GIT_HASH=%%i
|
|
||||||
|
|
||||||
for /f %%i in ('git status --porcelain 2^>nul') do (
|
|
||||||
set GIT_DIRTY=true
|
|
||||||
goto :dirty_done
|
|
||||||
)
|
|
||||||
:dirty_done
|
|
||||||
|
|
||||||
echo #pragma once> "$(ProjectDir)src\git.h"
|
|
||||||
echo // Auto-generated. Do not edit.>> "$(ProjectDir)src\git.h"
|
|
||||||
echo.>> "$(ProjectDir)src\git.h"
|
|
||||||
echo #define GIT_COMMIT_HASH "%GIT_HASH%">> "$(ProjectDir)src\git.h"
|
|
||||||
echo #define GIT_IS_DIRTY %GIT_DIRTY%>> "$(ProjectDir)src\git.h"
|
|
||||||
|
|
||||||
echo Created $(ProjectDir)src\git.h with commit %GIT_HASH% (dirty=%GIT_DIRTY%)
|
|
||||||
</Command>
|
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithLogging|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithLogging|Win32'">
|
||||||
@ -483,62 +253,10 @@ echo Created $(ProjectDir)src\git.h with commit %GIT_HASH% (dirty=%GIT_DIRTY%)
|
|||||||
<ModuleDefinitionFile>src\dinput8.def</ModuleDefinitionFile>
|
<ModuleDefinitionFile>src\dinput8.def</ModuleDefinitionFile>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>@echo off
|
<Command>call "$(ProjectDir)tools\post-build-dinput8.bat" "$(GTA2_DIR)" "$(GTA2_EXE)" "$(TargetPath)" "$(TargetDir)" "$(TargetName)"</Command>
|
||||||
|
|
||||||
echo Dinput8 proxy mode enabled
|
|
||||||
|
|
||||||
if "$(GTA2_DIR)"=="" (
|
|
||||||
echo ERROR: GTA2_DIR is not set. Make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if "$(GTA2_EXE)"=="" (
|
|
||||||
echo ERROR: GTA2_EXE is not set. Make sure to set it in GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if not exist "$(GTA2_DIR)\" (
|
|
||||||
echo ERROR: GTA2_DIR "$(GTA2_DIR)" specified in GTA2.props does not exist.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if not exist "$(GTA2_DIR)\$(GTA2_EXE)" (
|
|
||||||
echo ERROR: "$(GTA2_EXE)" not found in "$(GTA2_DIR)". Check GTA2.props file.
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
echo Copying "$(TargetPath)" to "$(GTA2_DIR)"
|
|
||||||
|
|
||||||
copy /Y "$(TargetPath)" "$(GTA2_DIR)\"
|
|
||||||
if errorlevel 1 exit /b 1
|
|
||||||
|
|
||||||
if exist "$(TargetDir)$(TargetName).pdb" (
|
|
||||||
copy /Y "$(TargetDir)$(TargetName).pdb" "$(GTA2_DIR)\"
|
|
||||||
)
|
|
||||||
|
|
||||||
exit /b 0
|
|
||||||
</Command>
|
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>set GIT_HASH=unknown
|
<Command>call "$(ProjectDir)tools\update-git-header.bat" "$(ProjectDir)"</Command>
|
||||||
set GIT_DIRTY=false
|
|
||||||
|
|
||||||
for /f %%i in ('git rev-parse --short HEAD 2^>nul') do set GIT_HASH=%%i
|
|
||||||
|
|
||||||
for /f %%i in ('git status --porcelain 2^>nul') do (
|
|
||||||
set GIT_DIRTY=true
|
|
||||||
goto :dirty_done
|
|
||||||
)
|
|
||||||
:dirty_done
|
|
||||||
|
|
||||||
echo #pragma once> "$(ProjectDir)src\git.h"
|
|
||||||
echo // Auto-generated. Do not edit.>> "$(ProjectDir)src\git.h"
|
|
||||||
echo.>> "$(ProjectDir)src\git.h"
|
|
||||||
echo #define GIT_COMMIT_HASH "%GIT_HASH%">> "$(ProjectDir)src\git.h"
|
|
||||||
echo #define GIT_IS_DIRTY %GIT_DIRTY%>> "$(ProjectDir)src\git.h"
|
|
||||||
|
|
||||||
echo Created $(ProjectDir)src\git.h with commit %GIT_HASH% (dirty=%GIT_DIRTY%)
|
|
||||||
</Command>
|
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
68
tools/post-build-asi.bat
Normal file
68
tools/post-build-asi.bat
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
set GTA2_DIR=%~1
|
||||||
|
set GTA2_EXE=%~2
|
||||||
|
set GTA2_ASI_DIR=%~3
|
||||||
|
set GTA2_ASI_FILENAME=%~4
|
||||||
|
set GTA2_ASI_PDB_FILENAME=%~5
|
||||||
|
set TARGET_PATH=%~6
|
||||||
|
set TARGET_DIR=%~7
|
||||||
|
set TARGET_NAME=%~8
|
||||||
|
|
||||||
|
echo ASI mode enabled
|
||||||
|
|
||||||
|
if "%GTA2_DIR%"=="" (
|
||||||
|
echo ERROR: GTA2_DIR is not set.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%GTA2_EXE%"=="" (
|
||||||
|
echo ERROR: GTA2_EXE is not set.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if not exist "%GTA2_DIR%\" (
|
||||||
|
echo ERROR: GTA2_DIR "%GTA2_DIR%" does not exist.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if not exist "%GTA2_DIR%\%GTA2_EXE%" (
|
||||||
|
echo ERROR: "%GTA2_EXE%" not found in "%GTA2_DIR%".
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%GTA2_ASI_DIR%"=="" (
|
||||||
|
echo ERROR: GTA2_ASI_DIR is not set.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%GTA2_ASI_FILENAME%"=="" (
|
||||||
|
echo ERROR: GTA2_ASI_FILENAME is not set.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if not exist "%GTA2_ASI_DIR%\" (
|
||||||
|
echo ERROR: GTA2_ASI_DIR "%GTA2_ASI_DIR%" does not exist.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
echo Copying "%TARGET_PATH%" to "%GTA2_ASI_DIR%\%GTA2_ASI_FILENAME%"
|
||||||
|
copy /Y "%TARGET_PATH%" "%GTA2_ASI_DIR%\%GTA2_ASI_FILENAME%" >nul
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo ERROR: Failed to copy to "%GTA2_ASI_DIR%\%GTA2_ASI_FILENAME%"
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
@REM if not "%GTA2_ASI_PDB_FILENAME%"=="" (
|
||||||
|
@REM if exist "%TARGET_DIR%\%TARGET_NAME%.pdb" (
|
||||||
|
@REM echo Copying "%TARGET_DIR%\%TARGET_NAME%.pdb" to "%GTA2_ASI_DIR%\%GTA2_ASI_PDB_FILENAME%"
|
||||||
|
@REM copy /Y "%TARGET_DIR%\%TARGET_NAME%.pdb" "%GTA2_ASI_DIR%\%GTA2_ASI_PDB_FILENAME%" >nul
|
||||||
|
@REM if errorlevel 1 (
|
||||||
|
@REM echo ERROR: Failed to copy to "%GTA2_ASI_DIR%\%GTA2_ASI_PDB_FILENAME%"
|
||||||
|
@REM exit /b 1
|
||||||
|
@REM )
|
||||||
|
@REM )
|
||||||
|
@REM )
|
||||||
|
|
||||||
|
exit /b 0
|
||||||
48
tools/post-build-dinput8.bat
Normal file
48
tools/post-build-dinput8.bat
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
set GTA2_DIR=%~1
|
||||||
|
set GTA2_EXE=%~2
|
||||||
|
set TARGET_PATH=%~3
|
||||||
|
set TARGET_DIR=%~4
|
||||||
|
set TARGET_NAME=%~5
|
||||||
|
|
||||||
|
echo Dinput8 proxy mode enabled
|
||||||
|
|
||||||
|
if "%GTA2_DIR%"=="" (
|
||||||
|
echo ERROR: GTA2_DIR is not set.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%GTA2_EXE%"=="" (
|
||||||
|
echo ERROR: GTA2_EXE is not set.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if not exist "%GTA2_DIR%\" (
|
||||||
|
echo ERROR: GTA2_DIR "%GTA2_DIR%" does not exist.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if not exist "%GTA2_DIR%\%GTA2_EXE%" (
|
||||||
|
echo ERROR: "%GTA2_EXE%" not found in "%GTA2_DIR%".
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
echo Copying "%TARGET_PATH%" to "%GTA2_DIR%\%TARGET_NAME%.dll"
|
||||||
|
copy /Y "%TARGET_PATH%" "%GTA2_DIR%\%TARGET_NAME%.dll" >nul
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo ERROR: Failed to copy to "%GTA2_DIR%\%TARGET_NAME%.dll"
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
@REM if exist "%TARGET_DIR%\%TARGET_NAME%.pdb" (
|
||||||
|
@REM echo Copying "%TARGET_DIR%\%TARGET_NAME%.pdb" to "%GTA2_DIR%\%TARGET_NAME%.pdb"
|
||||||
|
@REM copy /Y "%TARGET_DIR%\%TARGET_NAME%.pdb" "%GTA2_DIR%\%TARGET_NAME%.pdb" >nul
|
||||||
|
@REM if errorlevel 1 (
|
||||||
|
@REM echo ERROR: Failed to copy to "%GTA2_DIR%\%TARGET_NAME%.pdb"
|
||||||
|
@REM exit /b 1
|
||||||
|
@REM )
|
||||||
|
@REM )
|
||||||
|
|
||||||
|
exit /b 0
|
||||||
42
tools/update-git-header.bat
Normal file
42
tools/update-git-header.bat
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
set PROJECT_DIR=%~1
|
||||||
|
|
||||||
|
set HEADER=%PROJECT_DIR%src\git.h
|
||||||
|
set TEMP=%TEMP%\git.h.tmp
|
||||||
|
|
||||||
|
set GIT_HASH=unknown
|
||||||
|
set GIT_DIRTY=false
|
||||||
|
|
||||||
|
for /f %%i in ('git rev-parse --short HEAD 2^>nul') do set GIT_HASH=%%i
|
||||||
|
|
||||||
|
for /f %%i in ('git status --porcelain 2^>nul') do (
|
||||||
|
set GIT_DIRTY=true
|
||||||
|
goto dirty_done
|
||||||
|
)
|
||||||
|
|
||||||
|
:dirty_done
|
||||||
|
|
||||||
|
(
|
||||||
|
echo #pragma once
|
||||||
|
echo // Auto-generated. Do not edit.
|
||||||
|
echo.
|
||||||
|
echo #define GIT_COMMIT_HASH "%GIT_HASH%"
|
||||||
|
echo #define GIT_IS_DIRTY %GIT_DIRTY%
|
||||||
|
) > "%TEMP%"
|
||||||
|
|
||||||
|
if exist "%HEADER%" (
|
||||||
|
fc /b "%HEADER%" "%TEMP%" >nul
|
||||||
|
if not errorlevel 1 (
|
||||||
|
del "%TEMP%"
|
||||||
|
echo git.h unchanged
|
||||||
|
exit /b 0
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
move /Y "%TEMP%" "%HEADER%" >nul
|
||||||
|
|
||||||
|
echo Updated git.h (%GIT_HASH%, dirty=%GIT_DIRTY%)
|
||||||
|
|
||||||
|
exit /b 0
|
||||||
Loading…
Reference in New Issue
Block a user