x64dbg/build.bat

83 lines
2.5 KiB
Batchfile
Raw Permalink Normal View History

2015-04-06 02:27:28 +00:00
@echo off
echo Saving PATH
if "%OLDPATH%"=="" set OLDPATH=%PATH%
2015-10-17 22:58:15 +00:00
cd %~dp0
if /i "%1"=="x32" call setenv.bat x32&set type=Configuration=Release;Platform=Win32&goto build
if /i "%1"=="x64" call setenv.bat x64&set type=Configuration=Release;Platform=x64&goto build
2015-10-17 22:58:15 +00:00
if /i "%1"=="coverity" goto coverity
2017-10-08 12:50:17 +00:00
if /i "%1"=="sonarqube" goto sonarqube
2015-10-17 22:58:15 +00:00
goto usage
2015-04-06 02:27:28 +00:00
:build
2015-04-06 02:27:28 +00:00
echo Building DBG...
if "%MAXCORES%"=="" (
msbuild.exe x64dbg.sln /m /verbosity:minimal /t:Rebuild /p:%type%
) else (
set CL=/MP%MAXCORES%
msbuild.exe x64dbg.sln /m:1 /verbosity:minimal /t:Rebuild /p:%type%
)
2017-08-03 15:30:08 +00:00
if not %ERRORLEVEL%==0 exit
2015-04-06 02:27:28 +00:00
echo Building GUI...
rmdir /S /Q src\gui_build
cd src\gui
2015-10-17 22:58:15 +00:00
qmake x64dbg.pro CONFIG+=release
2017-08-03 15:30:08 +00:00
if not %ERRORLEVEL%==0 exit
if "%MAXCORES%"=="" (
jom
) else (
jom /J %MAXCORES%
)
2017-08-03 15:30:08 +00:00
if not %ERRORLEVEL%==0 exit
cd ..\..
goto :restorepath
2015-10-17 22:58:15 +00:00
:coverity
2015-10-18 16:58:08 +00:00
if "%2"=="" (
echo "Usage: build.bat coverity x32/x64"
goto usage
)
2015-10-17 22:58:15 +00:00
call setenv.bat coverity
echo Building with Coverity
cov-configure --msvc
cov-build --dir cov-int --instrument build.bat %2
goto :restorepath
2015-10-17 22:58:15 +00:00
2017-10-08 12:50:17 +00:00
:sonarqube
if "%2"=="" (
echo "Usage: build.bat sonarqube x32/x64"
goto usage
)
echo Building with SonarQube
build-wrapper --out-dir bw-output build.bat %2
if not defined APPVEYOR_PULL_REQUEST_NUMBER (
2018-03-04 21:35:01 +00:00
sonar-scanner -Dsonar.projectKey=x64dbg -Dsonar.sources=. -Dsonar.cfamily.build-wrapper-output=bw-output -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=mrexodia-github -Dsonar.login=%SONARQUBE_TOKEN% -Dsonar.exclusions=src/dbg/btparser/**,src/gui_build/**,src/zydis_wrapper/zydis/**
) else (
2018-03-04 21:35:01 +00:00
sonar-scanner -Dsonar.projectKey=x64dbg -Dsonar.sources=. -Dsonar.cfamily.build-wrapper-output=bw-output -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=mrexodia-github -Dsonar.login=%SONARQUBE_TOKEN% -Dsonar.exclusions=src/dbg/btparser/**,src/gui_build/**,src/zydis_wrapper/zydis/** -Dsonar.analysis.mode=preview -Dsonar.github.pullRequest=%APPVEYOR_PULL_REQUEST_NUMBER% -Dsonar.github.repository=x64dbg/x64dbg -Dsonar.github.oauth=%GITHUB_TOKEN%
)
goto :restorepath
2017-10-08 12:50:17 +00:00
2015-10-17 22:58:15 +00:00
:usage
2017-08-21 14:26:39 +00:00
echo "Usage: build.bat x32/x64/coverity"
2015-10-17 22:58:15 +00:00
echo.
echo Examples:
echo build.bat x32 : builds 32-bit release build
echo build.bat x64 : builds 64-bit release build
echo build.bat coverity x32 : builds 32-bit coverity build
echo build.bat coverity x64 : builds 64-bit coverity build
goto :restorepath
:restorepath
echo Resetting PATH
set PATH=%OLDPATH%
set OLDPATH=