-
Notifications
You must be signed in to change notification settings - Fork 34
/
coverity_build.bat
113 lines (91 loc) · 3.34 KB
/
coverity_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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
@ECHO OFF
rem Coverity scan automated build for WhiteCore
rem
rem This assumes that the Coverity standalone build package has been extracted into the directory
rem above the main repo.
rem
rem repos (or where you keep everything)
rem |--- cov-analysis
rem | -- WhiteCore-Dev
rem
rem The batch filename 'Compile.VS2010.net4_5.x64.debug.bat' is specific
rem to the system and build requirements. Adjust as appropriate
rem
rem This file is assumed to be in the top level WhiteCore-Dev directory
rem
rem greythane (Rowan Deppeler) - August 2019
rem
echo ========================================
echo ==== WhiteCore Coverity build ======
echo ========================================
rem ## Default "configuration" choice ((release, (debug)
set configuration=debug
rem ## Default Visual Studio edition
set vstudio=2019
rem ## Default Framework
set framework=4_8
rem ## End user selections ##
rem Determine current architecture in case
set bits=x86
if exist "%PROGRAMFILES(X86)%" (set bits=x64)
echo Creating solution
Prebuild.exe /target vs2015 /targetframework v%framework% /conditionals ISWIN;NET_%framework%
echo Setting up for build
set FileName=Compile.WhiteCore.bat
setlocal ENABLEEXTENSIONS
set VALUE_NAME=MSBuildToolsPath
rem try find vs2017
if "%PROCESSOR_ARCHITECTURE%"=="x86" set PROGRAMS=%ProgramFiles%
if defined ProgramFiles(x86) set PROGRAMS=%ProgramFiles(x86)%
for %%e in (Enterprise Professional Community) do (
if exist "%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\MSBuild.exe" (
set fpath="%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\"
goto :found
)
if exist "%PROGRAMS%\Microsoft Visual Studio\2019\%%e\MSBuild\Current\Bin\MSBuild.exe" (
set fpath="%PROGRAMS%\Microsoft Visual Studio\2019\%%e\MSBuild\Current\Bin\"
goto :found
)
)
rem We have to use grep or find to locate the correct line, because reg query spits
rem out 4 lines before Windows 7 but 2 lines after Windows 7.
rem We use grep if it's on the path; otherwise we use the built-in find command
rem from Windows. (We must use grep on Cygwin because it overrides the "find" command.)
for %%X in (grep.exe) do (set FOUNDGREP=%%~$PATH:X)
if defined FOUNDGREP (
set FINDCMD=grep
) else (
set FINDCMD=find
)
rem try vs2015
FOR /F "usebackq tokens=1-3" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v %VALUE_NAME% 2^>nul ^| %FINDCMD% "%VALUE_NAME%"`) DO (
set fpath=%%C
goto :found
)
echo msbuild for at least VS2015 not found, please install a (Community) edition of VS2019, VS2017 or VS2015
echo Not creating %FileName%
if exist %FileName% (
del %FileName%
)
goto :done
:found
echo Found msbuild at %fpath%
echo Creating build files
rem @echo %fpath%\msbuild opensim.sln > compile.bat
if %bits%==x64 (
set args=/p:Platform=x64
)
if %bits%==x86 (
set args=/p:Platform=x86
)
if %configuration%==release set cfg=/p:Configuration=Release
if %configuration%==debug set cfg=/p:Configuration=Debug
echo Creating %FileName%
echo %fpath%\msbuild WhiteCore.sln %args% %cfg% > %FileName% /p:DefineConstants="ISWIN;NET_%framework%
echo Let's do it...
..\cov-analysis\bin\cov-build.exe --dir cov-int Compile.WhiteCore.bat
echo Zip entire cov-int directory and upload to Coverity
echo Coverity build Finished
:done
set /p nothing= Enter to continue
exit