1
0
Форкнуть 0
Git-Credential-Manager-for-.../coverity.bat

81 строка
2.1 KiB
Batchfile
Исходник Постоянная ссылка Обычный вид История

2017-01-06 09:21:08 +03:00
@ECHO OFF
SETLOCAL
PUSHD %~dp0
SET PATH=C:\MSYS\bin;%PATH%
IF NOT DEFINED COVDIR SET "COVDIR=C:\cov-analysis"
IF DEFINED COVDIR IF NOT EXIST "%COVDIR%" (
ECHO.
ECHO ERROR: Coverity not found in "%COVDIR%"
GOTO End
)
2017-08-06 12:06:15 +03:00
CALL :SubVSPath
IF NOT EXIST "%VS_PATH%" CALL :SUBMSG "ERROR" "Visual Studio 2017 NOT FOUND!"
2017-01-06 09:21:08 +03:00
:Cleanup
IF EXIST "cov-int" RD /q /s "cov-int"
IF EXIST "gcw.lzma" DEL "gcw.lzma"
IF EXIST "gcw.tar" DEL "gcw.tar"
IF EXIST "gcw.tgz" DEL "gcw.tgz"
:Main
2017-08-06 12:06:15 +03:00
SET "TOOLSET=%VS_PATH%\Common7\Tools\vsdevcmd"
CALL "%TOOLSET%"
2017-01-06 09:21:08 +03:00
SET MSBUILD_SWITCHES=/nologo /t:Rebuild /p:Configuration=Release /p:Platform="Any CPU"^
/maxcpucount /consoleloggerparameters:DisableMPLogging;Summary;Verbosity=minimal
2017-03-22 14:08:42 +03:00
"%COVDIR%\bin\cov-build.exe" --dir cov-int MSBuild.exe GitCredentialManager.sln %MSBUILD_SWITCHES%
2017-01-06 09:21:08 +03:00
:tar
tar --version 1>&2 2>NUL || (ECHO. & ECHO ERROR: tar not found & GOTO SevenZip)
tar caf "gcw.lzma" "cov-int"
GOTO End
:SevenZip
CALL :SubDetectSevenzipPath
rem Coverity is totally bogus with lzma...
rem And since I cannot replicate the arguments with 7-Zip, just use tar/gzip.
IF EXIST "%SEVENZIP%" (
"%SEVENZIP%" a -ttar "gcw.tar" "cov-int"
"%SEVENZIP%" a -tgzip "gcw.tgz" "gcw.tar"
IF EXIST "gcw.tar" DEL "gcw.tar"
GOTO End
)
:SubDetectSevenzipPath
FOR %%G IN (7z.exe) DO (SET "SEVENZIP_PATH=%%~$PATH:G")
IF EXIST "%SEVENZIP_PATH%" (SET "SEVENZIP=%SEVENZIP_PATH%" & EXIT /B)
FOR %%G IN (7za.exe) DO (SET "SEVENZIP_PATH=%%~$PATH:G")
IF EXIST "%SEVENZIP_PATH%" (SET "SEVENZIP=%SEVENZIP_PATH%" & EXIT /B)
FOR /F "tokens=2*" %%A IN (
'REG QUERY "HKLM\SOFTWARE\7-Zip" /v "Path" 2^>NUL ^| FIND "REG_SZ" ^|^|
REG QUERY "HKLM\SOFTWARE\Wow6432Node\7-Zip" /v "Path" 2^>NUL ^| FIND "REG_SZ"') DO SET "SEVENZIP=%%B\7z.exe"
EXIT /B
2017-08-06 12:06:15 +03:00
:SubVSPath
FOR /f "delims=" %%A IN ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationPath -latest -requires Microsoft.Component.MSBuild Microsoft.VisualStudio.Component.VC.ATLMFC Microsoft.VisualStudio.Component.VC.Tools.x86.x64') DO SET "VS_PATH=%%A"
EXIT /B
2017-01-06 09:21:08 +03:00
:End
POPD
ECHO. & ECHO Press any key to close this window...
PAUSE >NUL
ENDLOCAL
EXIT /B