forked from SubtitleEdit/subtitleedit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_helpers.bat
60 lines (45 loc) · 1.38 KB
/
build_helpers.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
@ECHO OFF
SETLOCAL
PUSHD %~dp0
SET "ConfigurationName=%~2"
ECHO %cd%
IF /I "%~1" == "rsrc" GOTO UpdateResourceScript
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\ui\bin\%ConfigurationName%\SubtitleEdit.exe"
IF %ERRORLEVEL% NEQ 0 (
ECHO ERROR: Something went wrong when generating the resource script...
)
GOTO END
:UpdateLanguageFiles
SET "ToolPath=src\UpdateLanguageFiles\bin\%ConfigurationName%\UpdateLanguageFiles.exe"
IF NOT EXIST "%ToolPath%" (
ECHO Compile Subtitle Edit first!
GOTO END
)
"%ToolPath%" "LanguageMaster.xml" "src\libse\LanguageDeserializer.cs"
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%" (
ECHO Compile Subtitle Edit first!
GOTO END
)
"%ToolPath%" "src\ui\Properties\AssemblyInfo.cs.template" "src\libse\Properties\AssemblyInfo.cs.template"
IF %ERRORLEVEL% NEQ 0 (
ECHO ERROR: Something went wrong when generating the revision number...
)
GOTO END