2018-06-17 11:51:58 -04:00
|
|
|
:: Process commandline parameter
|
|
|
|
set ParamRelease=0
|
|
|
|
set ParamDebug=0
|
|
|
|
set ParamAutologin=0
|
|
|
|
set ParamPlugins=0
|
2020-08-10 18:23:25 -04:00
|
|
|
set ParamJsonApi=0
|
2022-02-02 09:39:03 -05:00
|
|
|
set ParamService=0
|
|
|
|
set ParamFriendServer=0
|
|
|
|
set ParamEmbeddedFriendServer=0
|
2020-11-29 16:05:03 -05:00
|
|
|
set ParamUseNativeDialogs=0
|
2018-06-17 11:51:58 -04:00
|
|
|
set ParamTor=0
|
2020-08-04 13:04:45 -04:00
|
|
|
set NonInteractive=0
|
2020-08-11 05:41:10 -04:00
|
|
|
set CoreCount=%NUMBER_OF_PROCESSORS%
|
2018-06-17 11:51:58 -04:00
|
|
|
|
2022-02-02 09:39:03 -05:00
|
|
|
set Module=%~1
|
|
|
|
shift /1
|
|
|
|
|
2018-06-17 11:51:58 -04:00
|
|
|
: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"=="autologin" (
|
|
|
|
set ParamAutologin=1
|
2020-08-10 18:23:25 -04:00
|
|
|
) else if "%%~a"=="jsonapi" (
|
|
|
|
set ParamJsonApi=1
|
2022-02-02 09:39:03 -05:00
|
|
|
) else if "%%~a"=="service" (
|
|
|
|
set ParamService=1
|
|
|
|
) else if "%%~a"=="friendserver" (
|
|
|
|
set ParamFriendServer=1
|
|
|
|
) else if "%%~a"=="embedded-friendserver" (
|
|
|
|
set ParamEmbeddedFriendServer=1
|
2018-06-17 11:51:58 -04:00
|
|
|
) else if "%%~a"=="plugins" (
|
|
|
|
set ParamPlugins=1
|
|
|
|
) else if "%%~a"=="tor" (
|
|
|
|
set ParamTor=1
|
2020-08-04 13:04:45 -04:00
|
|
|
) else if "%%~a"=="non-interactive" (
|
|
|
|
set NonInteractive=1
|
2020-08-11 05:41:10 -04:00
|
|
|
) else if "%%~a"=="singlethread" (
|
|
|
|
set CoreCount=1
|
2020-11-29 16:05:03 -05:00
|
|
|
) else if "%%~a"=="nativedialogs" (
|
|
|
|
set ParamUseNativeDialogs=1
|
2018-06-17 11:51:58 -04:00
|
|
|
) else (
|
|
|
|
echo.
|
2022-02-02 09:39:03 -05:00
|
|
|
echo Unknown parameter %1 for %Module%
|
2018-06-17 11:51:58 -04:00
|
|
|
goto :usage
|
|
|
|
)
|
|
|
|
)
|
|
|
|
shift /1
|
|
|
|
goto parameter_loop
|
|
|
|
)
|
|
|
|
|
|
|
|
if "%ParamRelease%"=="1" (
|
|
|
|
if "%ParamDebug%"=="1" (
|
2018-03-08 11:45:24 -05:00
|
|
|
echo.
|
2018-06-17 11:51:58 -04:00
|
|
|
echo Release or Debug?
|
|
|
|
goto :usage
|
2018-03-08 11:45:24 -05:00
|
|
|
)
|
2018-06-17 11:51:58 -04:00
|
|
|
|
|
|
|
set RsBuildConfig=release
|
|
|
|
) else if "%ParamDebug%"=="1" (
|
|
|
|
set RsBuildConfig=debug
|
|
|
|
) else goto :usage
|
|
|
|
|
|
|
|
if "%ParamTor%"=="1" (
|
|
|
|
set RsType=-tor
|
|
|
|
) else (
|
|
|
|
set RsType=
|
2018-03-08 11:45:24 -05:00
|
|
|
)
|
|
|
|
|
2016-09-06 15:31:41 -04:00
|
|
|
set BuildPath=%EnvRootPath%\builds
|
|
|
|
set DeployPath=%EnvRootPath%\deploy
|
|
|
|
|
|
|
|
if not exist "%BuildPath%" mkdir "%BuildPath%"
|
|
|
|
if not exist "%DeployPath%" mkdir "%DeployPath%"
|
|
|
|
|
|
|
|
:: Check Qt environment
|
|
|
|
set QtPath=
|
|
|
|
call "%ToolsPath%\find-in-path.bat" QtPath qmake.exe
|
2018-05-07 00:42:52 -04:00
|
|
|
if "%QtPath%"=="" %cecho% error "Please run command in the Qt Command Prompt." & exit /B 1
|
2016-09-06 15:31:41 -04:00
|
|
|
|
|
|
|
:: Check MinGW environment
|
|
|
|
set MinGWPath=
|
|
|
|
call "%ToolsPath%\find-in-path.bat" MinGWPath gcc.exe
|
2018-05-07 00:42:52 -04:00
|
|
|
if "%MinGWPath%"=="" %cecho% error "Please run command in the Qt Command Prompt." & exit /B 1
|
2016-09-06 15:31:41 -04:00
|
|
|
|
|
|
|
:: Get Qt version
|
|
|
|
call "%ToolsPath%\get-qt-version.bat" QtVersion
|
2018-05-07 00:42:52 -04:00
|
|
|
if "%QtVersion%"=="" %cecho% error "Cannot get Qt version." & exit /B 1
|
|
|
|
|
|
|
|
:: Get gcc versions
|
2017-02-27 02:16:48 -05:00
|
|
|
call "%ToolsPath%\get-gcc-version.bat" GCCVersion GCCArchitecture
|
2018-05-07 00:42:52 -04:00
|
|
|
if "%GCCVersion%"=="" %cecho% error "Cannot get gcc version." & exit /B 1
|
2017-02-27 02:16:48 -05:00
|
|
|
if "%GCCArchitecture%"=="" %cecho% error "Cannot get gcc architecture." & exit /B 1
|
2018-05-07 00:42:52 -04:00
|
|
|
|
2017-02-27 02:16:48 -05:00
|
|
|
set BuildLibsPath=%EnvRootPath%\build-libs\gcc-%GCCVersion%\%GCCArchitecture%
|
2016-09-06 15:31:41 -04:00
|
|
|
|
2017-02-27 02:16:48 -05:00
|
|
|
set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%GCCArchitecture%-%RsBuildConfig%
|
2020-08-03 12:14:32 -04:00
|
|
|
set RsDeployPath=%DeployPath%\Qt-%QtVersion%-%GCCArchitecture%%RsType%-%RsBuildConfig%
|
2016-09-06 15:31:41 -04:00
|
|
|
set RsPackPath=%DeployPath%
|
|
|
|
set RsArchiveAdd=
|
|
|
|
|
2016-10-04 15:45:59 -04:00
|
|
|
if not exist "%~dp0env-mod.bat" goto no_mod
|
|
|
|
call "%~dp0env-mod.bat"
|
2016-09-06 15:31:41 -04:00
|
|
|
if errorlevel 1 exit /B %ERRORLEVEL%
|
2016-10-04 15:45:59 -04:00
|
|
|
:no_mod
|
2016-09-06 15:31:41 -04:00
|
|
|
|
2018-06-17 11:51:58 -04:00
|
|
|
exit /B 0
|
|
|
|
|
|
|
|
:usage
|
|
|
|
echo.
|
2020-11-29 16:05:03 -05:00
|
|
|
echo Usage: release^|debug [^<optional parameters^>]
|
2018-06-17 11:51:58 -04:00
|
|
|
echo.
|
|
|
|
echo Mandatory parameter
|
2022-02-02 09:39:03 -05:00
|
|
|
echo release^|debug Build release or debug version
|
2018-06-17 11:51:58 -04:00
|
|
|
echo.
|
2022-02-02 09:39:03 -05:00
|
|
|
if "%Module%"=="build" (
|
|
|
|
echo Optional parameter ^(need clean when changed^)
|
|
|
|
echo autologin Build with autologin
|
|
|
|
echo jsonapi Build with jsonapi
|
|
|
|
echo service Build service
|
|
|
|
echo friendserver Build Friend Server
|
|
|
|
echo embedded-friendserver Build with embedded Friend Server
|
|
|
|
echo plugins Build plugins
|
|
|
|
echo nativedialogs Build with native dialogs
|
|
|
|
echo.
|
|
|
|
echo Optional parameter
|
|
|
|
echo singlethread Use only 1 thread for building
|
|
|
|
)
|
|
|
|
if "%Module%"=="pack" (
|
|
|
|
echo Optional parameter
|
|
|
|
echo service Pack service
|
|
|
|
echo friendserver Pack Friend Server ^(needs Tor^)
|
|
|
|
echo tor Pack Tor version
|
|
|
|
echo plugins Pack plugins
|
|
|
|
)
|
|
|
|
if "%Module%"=="git-log" (
|
|
|
|
echo Optional parameter
|
|
|
|
echo non-interactive Non-interactive mode
|
|
|
|
)
|
2020-08-04 13:04:45 -04:00
|
|
|
echo.
|
2018-06-17 11:51:58 -04:00
|
|
|
exit /B 2
|