SubtitleEdit/build_helpers.bat

58 lines
1.4 KiB
Batchfile
Raw Normal View History

2014-09-11 07:08:05 +02:00
@ECHO OFF
SETLOCAL
PUSHD %~dp0
SET "ConfigurationName=%~2"
2014-09-11 07:08:05 +02:00
IF /I "%~1" == "rsrc" GOTO UpdateResourceScript
2014-09-11 07:08:05 +02:00
IF /I "%~1" == "lang" GOTO UpdateLanguageFiles
IF /I "%~1" == "rev" GOTO UpdateAssemblyInfo
:END
POPD
ENDLOCAL
EXIT /B
:UpdateResourceScript
SET "ToolPath=src\UpdateResourceScript\bin\%ConfigurationName%\UpdateResourceScript.exe"
IF NOT EXIST "%ToolPath%" (
ECHO Compile Subtitle Edit first!
GOTO END
)
"%ToolPath%" "src\Win32Resources\Resources.rc.template" "src\bin\%ConfigurationName%\SubtitleEdit.exe"
IF %ERRORLEVEL% NEQ 0 (
ECHO ERROR: Something went wrong when generating the resource script...
)
GOTO END
2014-09-11 07:08:05 +02:00
:UpdateLanguageFiles
SET "ToolPath=src\UpdateLanguageFiles\bin\%ConfigurationName%\UpdateLanguageFiles.exe"
IF NOT EXIST "%ToolPath%" (
2014-09-11 07:08:05 +02:00
ECHO Compile Subtitle Edit first!
GOTO END
)
"%ToolPath%" "LanguageMaster.xml" "libse\LanguageDeserializer.cs"
2014-09-11 07:08:05 +02:00
IF %ERRORLEVEL% NEQ 0 (
ECHO ERROR: Something went wrong when generating the language files...
)
GOTO END
:UpdateAssemblyInfo
SET "ToolPath=src\UpdateAssemblyInfo\bin\%ConfigurationName%\UpdateAssemblyInfo.exe"
IF NOT EXIST "%ToolPath%" (
2014-09-11 07:08:05 +02:00
ECHO Compile Subtitle Edit first!
GOTO END
)
"%ToolPath%" "src\Properties\AssemblyInfo.cs.template" "libse\Properties\AssemblyInfo.cs.template"
2014-09-11 07:08:05 +02:00
IF %ERRORLEVEL% NEQ 0 (
ECHO ERROR: Something went wrong when generating the revision number...
)
GOTO END