forked from Belphemur/SoundSwitch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMake.bat
More file actions
100 lines (80 loc) · 3.01 KB
/
Make.bat
File metadata and controls
100 lines (80 loc) · 3.01 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
@echo off
setlocal
cd /d "%~dp0"
SET FILE_DIR=%~dp0
SET BIN_DIR=%FILE_DIR%bin
SET LANGS=(fr)
set finalDir=%FILE_DIR%Final
set x86Release=%finalDir%\x86
set x64Release=%finalDir%\x64
git describe --abbrev=0 --tags > latestTag.txt
for /f "delims=" %%i in ('git rev-list HEAD --count') do set commitCount=%%i
set /p latestTag=<latestTag.txt
del latestTag.txt
set releaseVersion=%latestTag%.%commitCount%
rmdir /q /s bin 1>nul 2>nul
rmdir /q /s obj 1>nul 2>nul
rmdir /q /s Release 1>nul 2>nul
rmdir /q /s %x86Release% 1>nul 2>nul
rmdir /q /s %x64Release% 1>nul 2>nul
mkdir %x86Release% 1>nul 2>nul
mkdir %x64Release% 1>nul 2>nul
set buildPlatform=Release
IF "%~1" neq "" (
set buildPlatform=%~1
)
set msbuildexe="%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
Echo Making SoundSwitch %buildPlatform%
Echo.
Echo "Build x86"
%msbuildexe% SoundSwitch.sln /m /p:Configuration=%buildPlatform% /p:Platform="x86" /v:q /t:rebuild
Echo "Build x64"
%msbuildexe% SoundSwitch.sln /m /p:Configuration=%buildPlatform% /p:Platform="x64" /v:q /t:rebuild
if not "%ERRORLEVEL%"=="0" (set builderror=1)
Echo.
if "%builderror%"=="1" echo error: build failed & goto Quit
echo "Generate Changelog"
cmd.exe /c markdown-html CHANGELOG.md -o %finalDir%\Changelog.html > NUL
echo "Generate README"
cmd.exe /c markdown-html README.md -o %finalDir%\Readme.html > NUL
echo "Copy LICENSE"
xcopy /y LICENSE.txt %finalDir% 1>nul 2>nul
Echo "Copy x64"
xcopy /y %BIN_DIR%\x64\Release\*.pdb %x64Release% 1>nul 2>nul
xcopy /y %BIN_DIR%\x64\Release\*.dll %x64Release% 1>nul 2>nul
xcopy /y %BIN_DIR%\x64\Release\SoundSwitch.exe %x64Release% 1>nul 2>nul
xcopy /y %BIN_DIR%\x64\Release\SoundSwitch.exe.config %x64Release% 1>nul 2>nul
for %%l in %LANGS% DO (
mkdir %x64Release%\%%l\
xcopy /y %BIN_DIR%\x64\Release\%%l\SoundSwitch.resources.dll %x64Release%\%%l\ 1>nul 2>nul
)
Echo "Copy x86"
xcopy /y %BIN_DIR%\x86\Release\*.pdb %x86Release% 1>nul 2>nul
xcopy /y %BIN_DIR%\x86\Release\*.dll %x86Release% 1>nul 2>nul
xcopy /y %BIN_DIR%\x86\Release\SoundSwitch.* %x86Release% 1>nul 2>nul
xcopy /y %BIN_DIR%\x86\Release\SoundSwitch.exe.config %x86Release% 1>nul 2>nul
for %%l in %LANGS% DO (
mkdir %x86Release%\%%l\
xcopy /y %BIN_DIR%\x86\Release\%%l\SoundSwitch.resources.dll %x86Release%\%%l\ 1>nul 2>nul
)
IF EXIST "%FILE_DIR%..\signinfo.txt" (
echo Signing release...
Echo.
call Sign.bat %x86Release%\SoundSwitch.exe
call Sign.bat %x64Release%\SoundSwitch.exe
call Sign.bat %x86Release%\AudioEndPointLibrary.dll
call Sign.bat %x64Release%\AudioEndPointLibrary.dll
call Sign.bat %x86Release%\Audio.EndPoint.Controller.Wrapper.dll
call Sign.bat %x64Release%\Audio.EndPoint.Controller.Wrapper.dll
for %%l in %LANGS% DO (
call Sign.bat %x86Release%\%%l\SoundSwitch.resources.dll
call Sign.bat %x64Release%\%%l\SoundSwitch.resources.dll
)
)
call ./Installer/Make-Installer.bat %buildPlatform%
if not "%ERRORLEVEL%"=="0" echo error: make installer failed & goto Quit
echo.
Echo All operations completed successfully.
:Quit
Echo.
Pause