Combine batch files.

This commit is contained in:
XhmikosR 2014-09-11 08:08:05 +03:00
parent addc5f7151
commit 8a53343d1d
4 changed files with 51 additions and 54 deletions

49
build_helpers.bat Normal file
View File

@ -0,0 +1,49 @@
@ECHO OFF
SETLOCAL
PUSHD %~dp0
IF /I "%~1" == "lang" GOTO UpdateLanguageFiles
IF /I "%~1" == "rev" GOTO UpdateAssemblyInfo
:END
POPD
ENDLOCAL
EXIT /B
:UpdateLanguageFiles
IF NOT EXIST "src\UpdateLanguageFiles\bin\Release\UpdateLanguageFiles.exe" IF NOT EXIST "src\UpdateLanguageFiles\bin\Debug\UpdateLanguageFiles.exe" (
ECHO Compile Subtitle Edit first!
GOTO END
)
IF EXIST "src\UpdateLanguageFiles\bin\Release\UpdateLanguageFiles.exe" (
"src\UpdateLanguageFiles\bin\Release\UpdateLanguageFiles.exe" "LanguageMaster.xml" "src\Logic\LanguageDeserializer.cs"
) ELSE (
"src\UpdateLanguageFiles\bin\Debug\UpdateLanguageFiles.exe" "LanguageMaster.xml" "src\Logic\LanguageDeserializer.cs"
)
IF %ERRORLEVEL% NEQ 0 (
ECHO ERROR: Something went wrong when generating the language files...
)
GOTO END
:UpdateAssemblyInfo
IF NOT EXIST "src\UpdateAssemblyInfo\bin\Release\UpdateAssemblyInfo.exe" IF NOT EXIST "src\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe" (
ECHO Compile Subtitle Edit first!
GOTO END
)
IF EXIST "src\UpdateAssemblyInfo\bin\Release\UpdateAssemblyInfo.exe" (
"src\UpdateAssemblyInfo\bin\Release\UpdateAssemblyInfo.exe" "src\Properties\AssemblyInfo.cs.template" "src\Properties\AssemblyInfo.cs"
) ELSE (
"src\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe" "src\Properties\AssemblyInfo.cs.template" "src\Properties\AssemblyInfo.cs"
)
IF %ERRORLEVEL% NEQ 0 (
ECHO ERROR: Something went wrong when generating the revision number...
)
GOTO END

View File

@ -1906,14 +1906,14 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>"$(ProjectDir)..\update_rev.bat"
<PreBuildEvent>"$(ProjectDir)..\build_helpers.bat" rev
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>COPY /Y /V "$(ProjectDir)Dlls\Hunspellx86.dll" "$(TargetDir)"
COPY /Y /V "$(ProjectDir)Dlls\Hunspellx64.dll" "$(TargetDir)"
COPY /Y /V "$(ProjectDir)Dlls\Interop.QuartzTypeLib.dll" "$(TargetDir)"
"$(ProjectDir)..\update_lang.bat"</PostBuildEvent>
"$(ProjectDir)..\build_helpers.bat" lang</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -1,26 +0,0 @@
@ECHO OFF
SETLOCAL
PUSHD %~dp0
IF NOT EXIST "src\UpdateLanguageFiles\bin\Release\UpdateLanguageFiles.exe" IF NOT EXIST "src\UpdateLanguageFiles\bin\Debug\UpdateLanguageFiles.exe" (
ECHO Compile Subtitle Edit first!
GOTO END
)
IF EXIST "src\UpdateLanguageFiles\bin\Release\UpdateLanguageFiles.exe" (
"src\UpdateLanguageFiles\bin\Release\UpdateLanguageFiles.exe" "LanguageMaster.xml" "src\Logic\LanguageDeserializer.cs"
) ELSE (
"src\UpdateLanguageFiles\bin\Debug\UpdateLanguageFiles.exe" "LanguageMaster.xml" "src\Logic\LanguageDeserializer.cs"
)
IF %ERRORLEVEL% NEQ 0 GOTO SubError
:END
POPD
ENDLOCAL
EXIT /B
:SubError
ECHO ERROR: Something went wrong when generating the language files...
EXIT /B

View File

@ -1,26 +0,0 @@
@ECHO OFF
SETLOCAL
PUSHD %~dp0
IF NOT EXIST "src\UpdateAssemblyInfo\bin\Release\UpdateAssemblyInfo.exe" IF NOT EXIST "src\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe" (
ECHO Compile Subtitle Edit first!
GOTO END
)
IF EXIST "src\UpdateAssemblyInfo\bin\Release\UpdateAssemblyInfo.exe" (
"src\UpdateAssemblyInfo\bin\Release\UpdateAssemblyInfo.exe" "src\Properties\AssemblyInfo.cs.template" "src\Properties\AssemblyInfo.cs"
) ELSE (
"src\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe" "src\Properties\AssemblyInfo.cs.template" "src\Properties\AssemblyInfo.cs"
)
IF %ERRORLEVEL% NEQ 0 GOTO SubError
:END
POPD
ENDLOCAL
EXIT /B
:SubError
ECHO ERROR: Something went wrong when generating the revision number...
EXIT /B