Skip to content
This repository has been archived by the owner on Aug 12, 2018. It is now read-only.

Commit

Permalink
Update coverity.bat.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Apr 13, 2014
1 parent 8233716 commit 8017b94
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/bin
/build.user.bat
/build/cov-int
/build/Notepad2-mod.lzma
/build/Notepad2-mod.tar
/build/Notepad2-mod.tgz
/build/packages
Expand Down
45 changes: 32 additions & 13 deletions build/coverity.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rem * Originally taken and adapted from https://github.com/mpc-hc/mpc-hc
rem *
rem * See License.txt for details about distribution and modification.
rem *
rem * (c) XhmikosR 2013
rem * (c) XhmikosR 2013-2014
rem * https://github.com/XhmikosR/notepad2-mod
rem *
rem ******************************************************************************
Expand All @@ -19,43 +19,62 @@ SETLOCAL

PUSHD %~dp0

IF NOT DEFINED COVDIR SET "COVDIR=H:\progs\thirdparty\cov-analysis-win64-6.6.1"
IF NOT DEFINED COVDIR SET "COVDIR=H:\progs\thirdparty\cov-analysis-win64-7.0.2"
IF DEFINED COVDIR IF NOT EXIST "%COVDIR%" (
ECHO.
ECHO ERROR: Coverity not found in "%COVDIR%"
GOTO End
)


CALL "%VS110COMNTOOLS%..\..\VC\vcvarsall.bat" x86
CALL "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" x86
IF %ERRORLEVEL% NEQ 0 (
ECHO vcvarsall.bat call failed.
GOTO End
)


:Cleanup
IF EXIST "cov-int" RD /q /s "cov-int"
IF EXIST "Notepad2-mod.lzma" DEL "Notepad2-mod.lzma"
IF EXIST "Notepad2-mod.tar" DEL "Notepad2-mod.tar"
IF EXIST "Notepad2-mod.tgz" DEL "Notepad2-mod.tgz"

"%COVDIR%\bin\cov-build.exe" --dir cov-int "build_vs2012.bat" Rebuild All Release

IF EXIST "Notepad2-mod.tar" DEL "Notepad2-mod.tar"
IF EXIST "Notepad2-mod.tgz" DEL "Notepad2-mod.tgz"
:Main
"%COVDIR%\bin\cov-build.exe" --dir cov-int "build_vs2013.bat" Rebuild All Release


:tar
tar --version 1>&2 2>NUL || (ECHO. & ECHO ERROR: tar not found & GOTO SevenZip)
tar czvf "Notepad2-mod.tgz" "cov-int"
tar caf "Notepad2-mod.lzma" "cov-int"
GOTO End


:SevenZip
IF NOT EXIST "%PROGRAMFILES%\7za.exe" (
ECHO.
ECHO ERROR: "%PROGRAMFILES%\7za.exe" not found
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 "Notepad2-mod.tar" "cov-int"
"%SEVENZIP%" a -tgzip "Notepad2-mod.tgz" "Notepad2-mod.tar"
IF EXIST "Notepad2-mod.tar" DEL "Notepad2-mod.tar"
GOTO End
)
"%PROGRAMFILES%\7za.exe" a -ttar "Notepad2-mod.tar" "cov-int"
"%PROGRAMFILES%\7za.exe" a -tgzip "Notepad2-mod.tgz" "Notepad2-mod.tar"
IF EXIST "Notepad2-mod.tar" DEL "Notepad2-mod.tar"


: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


:End
Expand Down

0 comments on commit 8017b94

Please sign in to comment.