Windows build environment

- Fixed creating git-log
- Added generating of changelog from MSYS2 build
This commit is contained in:
thunder2 2020-08-04 19:04:45 +02:00
parent b130ab2b0d
commit 08955c0818
6 changed files with 71 additions and 10 deletions

View File

@ -67,6 +67,14 @@ if exist "%EnvJomExe%" (
) else (
mingw32-make
)
if errorlevel 1 goto error
echo.
echo === Changelog
echo.
title Build - %SourceName%-%RsBuildConfig% [changelog]
call "%ToolsPath%\generate-changelog.bat" "%SourcePath%" "%RsBuildPath%\changelog.txt"
:error
popd

View File

@ -4,6 +4,7 @@ set ParamDebug=0
set ParamAutologin=0
set ParamPlugins=0
set ParamTor=0
set NonInteractive=0
:parameter_loop
if "%~1" NEQ "" (
@ -18,6 +19,8 @@ if "%~1" NEQ "" (
set ParamPlugins=1
) else if "%%~a"=="tor" (
set ParamTor=1
) else if "%%~a"=="non-interactive" (
set NonInteractive=1
) else (
echo.
echo Unknown parameter %1
@ -99,4 +102,7 @@ echo.
echo Parameter for pack
echo tor Pack tor version
echo.
echo Parameter for git-log
echo non-interactive Non-interactive mode
echo.
exit /B 2

View File

@ -2,9 +2,6 @@
setlocal
set NoAsk=
if "%~2"=="no-ask" set NoAsk=1
:: Initialize environment
call "%~dp0..\env.bat"
if errorlevel 1 goto error_env
@ -52,7 +49,7 @@ set RsLastRefFile=%BuildPath%\Qt-%QtVersion%-%GCCArchitecture%%RsType%-%RsBuildC
set RsLastRef=
if exist "%RsLastRefFile%" set /P RsLastRef=<"%RsLastRefFile%"
if "%NoAsk%"=="1" goto no_ask_for_last_revision
if "%NonInteractive%"=="1" goto no_ask_for_last_revision
if not "%RsLastRef%"=="" echo Last Revision was %RsLastRef%
set /P RsLastRefInput=Last Revision:
if "%RsLastRefInput%" NEQ "" set RsLastRef=%RsLastRefInput%
@ -70,7 +67,7 @@ echo.
echo Creating log from %RsLastRef%
echo to %RsRef%
if "%NoAsk%"=="1" goto no_confirm
if "%NonInteractive%"=="1" goto no_confirm
choice /M "Do you want to proceed?"
if %errorlevel%==2 exit /B 1
:no_confirm

View File

@ -165,8 +165,8 @@ if "%QtMainVersion%"=="5" (
echo copy bdboot.txt
copy "%SourcePath%\libbitdht\src\bitdht\bdboot.txt" "%RsDeployPath%" %Quite%
rem echo copy changelog.txt
rem copy "%SourcePath%\retroshare-gui\src\changelog.txt" "%RsDeployPath%" %Quite%
echo copy changelog.txt
copy "%RsBuildPath%\changelog.txt" "%RsDeployPath%" %Quite%
if exist "%SourcePath%\libresapi\src\webui" (
echo copy webui

View File

@ -110,8 +110,8 @@ Var StyleSheetDir
!define MUI_FINISHPAGE_LINK "Visit the RetroShare forum for the latest news and support"
!define MUI_FINISHPAGE_LINK_LOCATION "http://retroshare.sourceforge.net/forum/"
!define MUI_FINISHPAGE_RUN "$INSTDIR\retroshare.exe"
;!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\changelog.txt
;!define MUI_FINISHPAGE_SHOWREADME_TEXT changelog.txt
!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\changelog.txt
!define MUI_FINISHPAGE_SHOWREADME_TEXT changelog.txt
;!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
@ -230,7 +230,7 @@ Section $(Section_Main) Section_Main
!endif
; Other files
; File "${SOURCEDIR}\retroshare-gui\src\changelog.txt"
File "${RELEASEDIR}\changelog.txt"
File "${SOURCEDIR}\libbitdht\src\bitdht\bdboot.txt"
; License

View File

@ -0,0 +1,50 @@
@echo off
setlocal enabledelayedexpansion
if "%~2"=="" (
echo.
echo Parameter error.
echo Usage %~n0 sourcepath outputfile
exit /B 1
)
:: Check git executable
set GitPath=
call "%~dp0find-in-path.bat" GitPath git.exe
if "%GitPath%"=="" echo Git executable not found in PATH.& exit /B 1
set logfile=%~2
copy nul %logfile% > nul
pushd %~1
set last=HEAD
for /f %%t in ('git tag --sort=-taggerdate --merged ^| findstr v') do (
echo generating changelog for !last!..%%t
echo ----------------------------------------------- >> %logfile%
if !last! neq HEAD (
git tag -n !last! >> %logfile%
) else (
echo HEAD >> %logfile%
)
rem echo !last! ---^> %%t >> %logfile%
echo ----------------------------------------------- >> %logfile%
echo. >> %logfile%
git log %%t..!last! --no-merges "--pretty=format:%%h %%ai %%<(10,trunc)%%an %%s" >> %logfile%
echo. >> %logfile%
echo. >> %logfile%
set last=%%t
)
echo generating changelog for %last%
echo ----------------------------------------------- >> %logfile%
git tag -n %last% >> %logfile%
echo ----------------------------------------------- >> %logfile%
echo. >> %logfile%
git log %last% --no-merges "--pretty=format:%%h %%ai %%<(10,trunc)%%an %%s" >> %logfile%
popd
endlocal enabledelayedexpansion
exit /B 0