-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.bat
70 lines (63 loc) · 2.69 KB
/
build.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
61
62
63
64
65
66
67
68
69
70
@echo off
setlocal
pushd "%~dp0"
REM ILMerge does not work correctly with 4.0 runtime
REM set ILMERGE_PATH=
REM for %%I in (ilmerge.exe) do @IF EXIST "%%~dp$PATH:I" set ILMERGE_PATH=%%~dp$PATH:I
REM IF NOT EXIST "%ILMERGE_PATH%" set ILMERGE_PATH=%ProgramFiles%\Microsoft\ILMerge
REM IF NOT EXIST "%ILMERGE_PATH%" set ILMERGE_PATH=%ProgramFiles(x86)%\Microsoft\ILMerge
REM IF NOT EXIST "%ILMERGE_PATH%" (
REM Echo ILMerge.exe not found on PATH. Build will not succeed. Aborting
REM goto exit
REM )
REM IF NOT EXIST "%ILMERGE_PATH%\ILMerge.exe.config" (
REM Echo ILMerge.exe.config not in ILMerge Folder. Build will not succeed with .NET 4.0
REM Echo Create file with :
REM echo <configuration><startup useLegacyV2RuntimeActivationPolicy="true"><requiredRuntime safemode="true" imageVersion="v4.0.30319" version="v4.0.30319"/></startup></configuration>
REM goto exit
REM )
for %%I in (git.exe) do @IF EXIST "%%~dp$PATH:I" set GIT_PATH=%%~dp$PATH:I
IF NOT EXIST "%GIT_PATH%" set GIT_PATH=%ProgramFiles%\Git\cmd
IF NOT EXIST "%GIT_PATH%" set GIT_PATH=%ProgramFiles(x86)%\Git\cmd
IF NOT EXIST "%GIT_PATH%" (
Echo Git.CMD not found on PATH. Build will not succeed. Aborting
goto exit
)
set PATH=%PATH%;%ILMERGE_PATH%;%GIT_PATH%
if "%VCINSTALLDIR%" == "" (
if exist "%VS110COMNTOOLS%\vsvars32.bat" (
call "%VS110COMNTOOLS%\vsvars32.bat"
) else (
if exist "%VS100COMNTOOLS%\vsvars32.bat" (
call "%VS100COMNTOOLS%\vsvars32.bat"
) else (
if exist "%VS90COMNTOOLS%\vsvars32.bat" (
call "%VS90COMNTOOLS%\vsvars32.bat"
) else (
if exist "%VS80COMNTOOLS%\vsvars32.bat" (
call "%VS80COMNTOOLS%\vsvars32.bat"
)
)
)
)
)
for %%I in (msbuild.exe) do @IF EXIST "%%~dp$PATH:I" set MSBUILD_PATH=%%~dp$PATH:I
IF NOT EXIST "%MSBUILD_PATH%" (
Echo MSBuild.exe not found on PATH. Build will not succeed. Aborting
goto exit
)
SET BUILD_OPTIONS=
for %%I in (rar.exe) do @IF EXIST "%%~dp$PATH:I" set RAR_PATH=%%~dp$PATH:I
IF NOT EXIST "%RAR_PATH%" set RAR_PATH=%ProgramFiles%\WinRAR\
IF NOT EXIST "%RAR_PATH%" set RAR_PATH=%ProgramFiles(x86)%\WinRAR\
REM IF EXIST "%RAR_PATH%" set BUILD_OPTIONS=%BUILD_OPTIONS%,package_rar
for %%I in (7za.exe) do @IF EXIST "%%~dp$PATH:I" set SZA_PATH=%%~dp$PATH:I
IF NOT EXIST "%SZA_PATH%" set SZA_PATH=%ProgramFiles%\WinRAR\
IF NOT EXIST "%SZA_PATH%" set SZA_PATH=%ProgramFiles(x86)%\WinRAR\
IF EXIST "%SZA_PATH%" set BUILD_OPTIONS=%BUILD_OPTIONS%,package_7z
REM 2 pass build since copy does not pickup source files generated or copied during build process
msbuild build.proj /p:Configuration=Release /p:Platform="AnyCPU" /t:version_force,build,afterbuild
msbuild build.proj /p:Configuration=Release /p:Platform="AnyCPU" /t:version_import,package%BUILD_OPTIONS%
:exit
popd
endlocal