Optimized Windows build environment

This commit is contained in:
thunder2 2018-06-17 17:51:58 +02:00
parent 93ab975b72
commit 1eed404170
14 changed files with 185 additions and 295 deletions

View file

@ -9,7 +9,7 @@ call "%EnvPath%\env.bat"
if errorlevel 1 goto error_env
:: Initialize environment
call "%~dp0env.bat" standard
call "%~dp0env.bat" release
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
@ -29,6 +29,7 @@ set NSIS_PARAM=%NSIS_PARAM% /DQTDIR="%QtPath%\.."
set NSIS_PARAM=%NSIS_PARAM% /DMINGWDIR="%MinGWPath%\.."
set NSIS_PARAM=%NSIS_PARAM% /DOUTDIR="%RsPackPath%"
set NSIS_PARAM=%NSIS_PARAM% /DINSTALLERADD="%RsArchiveAdd%"
set NSIS_PARAM=%NSIS_PARAM% /DEXTERNAL_LIB_DIR="%BuildLibsPath%\libs"
:: Scan version from source
set RsRevision=

View file

@ -22,6 +22,7 @@ set /P LibsGCCVersion=<"%BuildLibsPath%\libs\gcc-version"
if "%LibsGCCVersion%" NEQ "%GCCVersion%" %cecho% error "Please use correct version of external libraries. (gcc %GCCVersion% ^<^> libs %LibsGCCVersion%)." & exit /B 1
:: Check git executable
if "%ParamVersion%"=="0" goto found_git
set GitPath=
call "%ToolsPath%\find-in-path.bat" GitPath git.exe
if "%GitPath%" NEQ "" goto found_git
@ -33,7 +34,7 @@ echo.
echo === Version
echo.
title Build - %SourceName%%RsType%-%RsBuildConfig% [Version]
title Build - %SourceName%-%RsBuildConfig% [Version]
pushd "%SourcePath%\retroshare-gui\src\gui\images"
:: Touch resource file
@ -47,10 +48,12 @@ echo.
echo === qmake
echo.
title Build - %SourceName%%RsType%-%RsBuildConfig% [qmake]
title Build - %SourceName%-%RsBuildConfig% [qmake]
set RS_QMAKE_CONFIG=%RsBuildConfig% version_detail_bash_script rs_autologin retroshare_plugins
if "%RsRetroTor%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% retrotor
set RS_QMAKE_CONFIG=%RsBuildConfig%
if "%ParamVersion%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% version_detail_bash_script
if "%ParamAutologin%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% rs_autologin
if "%ParamPlugins%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% retroshare_plugins
qmake "%SourcePath%\RetroShare.pro" -r -spec win32-g++ "CONFIG+=%RS_QMAKE_CONFIG%" "EXTERNAL_LIB_DIR=%BuildLibsPath%\libs"
if errorlevel 1 goto error
@ -59,7 +62,7 @@ echo.
echo === make
echo.
title Build - %SourceName%%RsType%-%RsBuildConfig% [make]
title Build - %SourceName%-%RsBuildConfig% [make]
if exist "%EnvJomExe%" (
"%EnvJomExe%"

View file

@ -7,7 +7,9 @@ call "%~dp0..\env.bat"
if errorlevel 1 goto error_env
call "%EnvPath%\env.bat"
if errorlevel 1 goto error_env
call "%~dp0env.bat" %*
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
if not exist "%RsBuildPath%" exit /B 0

View file

@ -1,16 +1,52 @@
if "%~1"=="standard" (
set RsRetroTor=
set RsType=
) else (
if "%~1"=="retrotor" (
set RsRetroTor=1
set RsType=-tor
) else (
echo.
echo Usage: standard^|retrotor
echo.
exit /B 2
:: Process commandline parameter
set ParamRelease=0
set ParamDebug=0
set ParamVersion=0
set ParamAutologin=0
set ParamPlugins=0
set ParamTor=0
:parameter_loop
if "%~1" NEQ "" (
for /f "tokens=1,2 delims==" %%a in ("%~1") do (
if "%%~a"=="release" (
set ParamRelease=1
) else if "%%~a"=="debug" (
set ParamDebug=1
) else if "%%~a"=="version" (
set ParamVersion=1
) else if "%%~a"=="autologin" (
set ParamAutologin=1
) else if "%%~a"=="plugins" (
set ParamPlugins=1
) else if "%%~a"=="tor" (
set ParamTor=1
) else (
echo.
echo Unknown parameter %1
goto :usage
)
)
shift /1
goto parameter_loop
)
if "%ParamRelease%"=="1" (
if "%ParamDebug%"=="1" (
echo.
echo Release or Debug?
goto :usage
)
set RsBuildConfig=release
) else if "%ParamDebug%"=="1" (
set RsBuildConfig=debug
) else goto :usage
if "%ParamTor%"=="1" (
set RsType=-tor
) else (
set RsType=
)
set BuildPath=%EnvRootPath%\builds
@ -39,8 +75,7 @@ if "%GCCVersion%"=="" %cecho% error "Cannot get gcc version." & exit /B 1
set BuildLibsPath=%EnvRootPath%\build-libs\gcc-%GCCVersion%
set RsBuildConfig=release
set RsBuildPath=%BuildPath%\Qt-%QtVersion%%RsType%-%RsBuildConfig%
set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsBuildConfig%
set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsBuildConfig%
set RsPackPath=%DeployPath%
set RsArchiveAdd=
@ -50,4 +85,21 @@ call "%~dp0env-mod.bat"
if errorlevel 1 exit /B %ERRORLEVEL%
:no_mod
exit /B 0
exit /B 0
:usage
echo.
echo Usage: release^|debug [version autologin plugins]
echo.
echo Mandatory parameter
echo release^|debug Build release or debug version
echo.
echo Optional parameter (need clean when changed)
echo version Create version information from git
echo autologin Build with autologin
echo plugins Build plugins
echo.
echo Parameter for pack
echo tor Pack tor version
echo.
exit /B 2

View file

@ -1,6 +1,3 @@
:: Usage:
:: call git-log.bat standard|retrotor [no-ask]
@echo off
setlocal
@ -13,7 +10,9 @@ call "%~dp0..\env.bat"
if errorlevel 1 goto error_env
call "%EnvPath%\env.bat"
if errorlevel 1 goto error_env
call "%~dp0env.bat" %1
call "%~dp0env.bat" %*
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
:: Check git executable

View file

@ -62,8 +62,8 @@ set RsDate=
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set RsDate=%%I
set RsDate=%RsDate:~0,4%%RsDate:~4,2%%RsDate:~6,2%
if "%RsRetroTor%"=="1" (
:: Check Retrotor
if "%ParamTor%"=="1" (
:: Check for tor executable
if not exist "%EnvDownloadPath%\tor\Tor\tor.exe" (
echo Tor binary not found. Please download Tor Expert Bundle from
echo https://www.torproject.org/download/download.html.en
@ -121,7 +121,7 @@ for /D %%D in ("%RsBuildPath%\plugins\*") do (
)
echo copy external binaries
copy "%RootPath%\libs\bin\*.dll" "%RsDeployPath%" %Quite%
copy "%BuildLibsPath%\libs\bin\*.dll" "%RsDeployPath%" %Quite%
echo copy dependencies
call :copy_dependencies "%RsDeployPath%\retroshare.exe" "%RsDeployPath%"
@ -180,7 +180,7 @@ if exist "%SourcePath%\libresapi\src\webui" (
xcopy /S "%SourcePath%\libresapi\src\webui" "%RsDeployPath%\webui" %Quite%
)
if "%RsRetroTor%"=="1" (
if "%ParamTor%"=="1" (
echo copy tor
echo n | copy /-y "%EnvDownloadPath%\tor\Tor\*.*" "%RsDeployPath%" %Quite%
)
@ -217,13 +217,19 @@ if exist "%~1\%RsBuildConfig%\%~n1.dll" (
goto :EOF
:copy_dependencies
set CopyDependenciesCopiedSomething=0
for /F "usebackq" %%A in (`%ToolsPath%\depends.bat list %1`) do (
if exist "%QtPath%\%%A" (
copy "%QtPath%\%%A" %2 %Quite%
) else (
if exist "%MinGWPath%\%%A" (
copy "%MinGWPath%\%%A" %2 %Quite%
if not exist "%~2\%%A" (
if exist "%QtPath%\%%A" (
set CopyDependenciesCopiedSomething=1
copy "%QtPath%\%%A" %2 %Quite%
) else (
if exist "%MinGWPath%\%%A" (
set CopyDependenciesCopiedSomething=1
copy "%MinGWPath%\%%A" %2 %Quite%
)
)
)
)
if "%CopyDependenciesCopiedSomething%"=="1" goto copy_dependencies
goto :EOF