Merge branch 'master' into TheWire-fix-Show-Follow-Buttons

This commit is contained in:
drbob 2020-08-10 09:19:52 +10:00
commit a68522e3b0
23 changed files with 220 additions and 52 deletions

View File

@ -25,7 +25,7 @@ if exist "%EnvMSYS2Path%\msys%MSYS2Base%\usr\bin\pacman.exe" (
)
)
set MSYS2Install=msys2-base-%MSYS2Architecture%-20180531.tar.xz
set MSYS2Install=msys2-base-%MSYS2Architecture%-20200720.tar.xz
set MSYS2Url=http://sourceforge.net/projects/msys2/files/Base/%MSYS2Architecture%/%MSYS2Install%/download
%cecho% info "Remove previous MSYS2 version"

View File

@ -7,6 +7,10 @@ This guide contains information about how to setup your build environment in an
If you prefer to setup your environment manually, check this guide:
[WindowsMSys2_InstallGuide.md](WindowsMSys2_InstallGuide.md)
Setting up the build environment automatically on a 32 bit OS is not possible anymore.
You can download an older 32 bit [MSYS2 installer](https://sourceforge.net/projects/msys2/files/Base/i686/msys2-base-i686-20180531.tar.xz/download) and follow the manual setup instructions.
Building 32 bit RetroShare from the 64 bit build environment is still possible.
You have to clone this repository (with [git for windows](https://gitforwindows.org/)) to a local folder, then start it in a terminal.
@ -16,7 +20,7 @@ Run the following script:
<sourcefolder>\build_scripts\Windows-msys2\build.bat
It will install all neccessary tools to build RetrosShare, and build it with the default configuration.
It will install all necessary tools to build RetrosShare, and build it with the default configuration.
After the script is finished, you can find the resulting .7z package here:
@ -24,7 +28,7 @@ After the script is finished, you can find the resulting .7z package here:
## Advanced building
You can specifiy extra build options if you use the scripts under:
You can specify extra build options if you use the scripts under:
<sourcefolder>\build_scripts\Windows-msys2\build\
@ -63,7 +67,7 @@ build-installer.bat 64 release autologin
```
## Troubleshooting
* Run the command again, sometimes it works the second time, specially if it complains about *restbed* during bulding
* Run the command again, sometimes it works the second time, specially if it complains about *restbed* during building
* Delete the build artifacts: *&lt;sourcefolder&gt;-msys2\deploy\builds*
* Update msys2 manually:
1. Open the terminal: *&lt;sourcefolder&gt;-msys2\msys2\msys64\msys2.exe*
@ -73,11 +77,15 @@ build-installer.bat 64 release autologin
5. Jump to 1. until it doesn't find more updates
* Start with a clean path environment variable, run *&lt;sourcefolder&gt;\build_scripts\Windows-msys2\start-clean-env.bat*, you will get a terminal with cleaned path
### Errors during MSYS2 update
MSYS2 developers recently introduced some breaking changes.
If you get PGP related errors during updating the system from pacman, then follow [their guide](https://www.msys2.org/news/#2020-06-29-new-packagers) to resolve the problems.
## Updating webui
The sripts don't update the webui source code automatically once it is schecked out.
The scripts don't update the webui source code automatically once it is checked out.
You have to do it manually with your favourite git client.
You can find the webui sorce code here:
You can find the webui source code here:
<sourcefolder>-webui

View File

@ -21,6 +21,12 @@ if not exist "%BuildLibsPath%\libs\gcc-version" %cecho% error "Cannot get gcc ve
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
:: Get date
call "%ToolsPath%\get-rs-date.bat" "%SourcePath%" RsDate
if errorlevel 1 %cecho% error "Could not get date."& goto error
if "%RsDate%"=="" %cecho% error "Could not get date."& goto error
:: Build defines for script
set NSIS_PARAM=
@ -31,6 +37,9 @@ set NSIS_PARAM=%NSIS_PARAM% /DOUTDIR="%RsPackPath%"
set NSIS_PARAM=%NSIS_PARAM% /DINSTALLERADD="%RsArchiveAdd%"
set NSIS_PARAM=%NSIS_PARAM% /DEXTERNAL_LIB_DIR="%BuildLibsPath%\libs"
set NSIS_PARAM=%NSIS_PARAM% /DARCHITECTURE="%GCCArchitecture%"
set NSIS_PARAM=%NSIS_PARAM% /DDATE="%RsDate%"
if exist "%EnvTorPath%\Tor\tor.exe" set NSIS_PARAM=%NSIS_PARAM% /DTORDIR="%EnvTorPath%\Tor"
:: Get compiled version
call "%ToolsPath%\get-rs-version.bat" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion

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
@ -20,16 +17,8 @@ set GitPath=
call "%ToolsPath%\find-in-path.bat" GitPath git.exe
if "%GitPath%"=="" echo Git executable not found in PATH.& exit /B 1
:: Get compiled revision
set GetRsVersion=%SourcePath%\build_scripts\Windows\tools\get-rs-version.bat
if not exist "%GetRsVersion%" (
echo File not found
echo %GetRsVersion%
exit /B 1
)
:: Get compiled version
call "%GetRsVersion%" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion
call "%ToolsPath%\get-rs-version.bat" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion
if errorlevel 1 %cecho% error "Version not found."& goto error
if "%RsVersion.Major%"=="" %cecho% error "Major version not found."& goto error
@ -39,20 +28,18 @@ if "%RsVersion.Extra%"=="" %cecho% error "Extra number not found".& goto error
set RsVersion=%RsVersion.Major%.%RsVersion.Minor%.%RsVersion.Mini%
:: Check WMIC is available
wmic.exe alias /? >nul 2>&1 || echo WMIC is not available.&& exit /B 1
:: Get date
call "%ToolsPath%\get-rs-date.bat" "%SourcePath%" RsDate
if errorlevel 1 %cecho% error "Could not get date."& goto error
:: Use WMIC to retrieve date in format YYYYMMDD
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 "%RsDate%"=="" %cecho% error "Could not get date."& goto error
:: Get last revision
set RsLastRefFile=%BuildPath%\Qt-%QtVersion%-%GCCArchitecture%%RsType%-%RsBuildConfig%-LastRef.txt
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 +57,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

@ -29,16 +29,8 @@ if exist "%RsDeployPath%" rmdir /S /Q "%RsDeployPath%"
:: Check compilation
if not exist "%RsBuildPath%\Makefile" echo Project is not compiled.& goto error
:: Get compiled revision
set GetRsVersion=%SourcePath%\build_scripts\Windows\tools\get-rs-version.bat
if not exist "%GetRsVersion%" (
%cecho% error "File not found"
echo %GetRsVersion%
goto error
)
:: Get compiled version
call "%GetRsVersion%" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion
call "%ToolsPath%\get-rs-version.bat" "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare.exe" RsVersion
if errorlevel 1 %cecho% error "Version not found."& goto error
if "%RsVersion.Major%"=="" %cecho% error "Major version not found."& goto error
@ -48,18 +40,17 @@ if "%RsVersion.Extra%"=="" %cecho% error "Extra number not found".& goto error
set RsVersion=%RsVersion.Major%.%RsVersion.Minor%.%RsVersion.Mini%
:: Check WMIC is available
wmic.exe alias /? >nul 2>&1 || echo WMIC is not available.&& goto error
:: Get date
call "%ToolsPath%\get-rs-date.bat" "%SourcePath%" RsDate
if errorlevel 1 %cecho% error "Could not get date."& goto error
:: Use WMIC to retrieve date in format YYYYMMDD
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 "%RsDate%"=="" %cecho% error "Could not get date."& goto error
rem Tor
if "%ParamTor%"=="1" (
:: Check for tor executable
if not exist "%EnvDownloadPath%\tor\Tor\tor.exe" (
%cecho% error "Tor binary not found. Please download Tor Expert Bundle from\nhttps://www.torproject.org/download/download.html.en\nand unpack to\n%EnvDownloadPath:\=\\%\\tor"
if not exist "%EnvTorPath%\Tor\tor.exe" (
%cecho% error "Tor binary not found. Please download Tor Expert Bundle from\nhttps://www.torproject.org/download/download.html.en\nand unpack to\n%EnvTorPath:\=\\%"
goto error
)
)
@ -165,8 +156,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
@ -176,7 +167,7 @@ if exist "%SourcePath%\libresapi\src\webui" (
if "%ParamTor%"=="1" (
echo copy tor
echo n | copy /-y "%EnvDownloadPath%\tor\Tor\*.*" "%RsDeployPath%" %Quite%
echo n | copy /-y "%EnvTorPath%\*.*" "%RsDeployPath%" %Quite%
)
rem pack files

View File

@ -6,6 +6,7 @@ set EnvRootPath=%RootPath%\%SourceName%-env
set EnvToolsPath=%EnvRootPath%\tools
set EnvTempPath=%EnvRootPath%\tmp
set EnvDownloadPath=%EnvRootPath%\download
set EnvTorPath=%EnvDownloadPath%\tor
set EnvSevenZipExe=%EnvToolsPath%\7z.exe
set EnvJomExe=%EnvToolsPath%\jom.exe

View File

@ -22,6 +22,8 @@ set CMakeVersion=cmake-3.1.0-win32-x86
set CMakeInstall=%CMakeVersion%.zip
set CMakeUrl=http://www.cmake.org/files/v3.1/%CMakeInstall%
set CMakeInstallPath=%EnvToolsPath%\cmake
set TorProjectUrl=https://www.torproject.org
set TorDownloadIndexUrl=%TorProjectUrl%/download/tor
if not exist "%EnvToolsPath%\7z.exe" (
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
@ -170,10 +172,33 @@ if not exist "%CMakeInstallPath%\bin\cmake.exe" (
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
)
rem Tor
rem Get download link and filename from download page
mkdir "%EnvTempPath%"
call "%ToolsPath%\download-file.bat" "%TorDownloadIndexUrl%" "%EnvTempPath%\index.html"
if not exist "%EnvTempPath%\index.html" %cecho% error "Cannot download Tor installation" & goto error
for /F "tokens=1,2 delims= " %%A in ('%EnvSedExe% -r -n -e"s/.*href=\"^(.*^)^(tor-win32.*\.zip^)\".*/\2 \1\2/p" "%EnvTempPath%\index.html"') do set TorInstall=%%A& set TorDownloadUrl=%TorProjectUrl%%%B
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
if "%TorInstall%"=="" %cecho% error "Cannot download Tor installation" & goto error
if "%TorDownloadUrl%"=="" %cecho% error "Cannot download Tor installation" & goto error
if not exist "%EnvDownloadPath%\%TorInstall%" call "%ToolsPath%\remove-dir.bat" "%EnvTorPath%"
if not exist "%EnvTorPath%\Tor\tor.exe" (
%cecho% info "Download Tor installation"
if not exist "%EnvDownloadPath%\%TorInstall%" call "%ToolsPath%\download-file.bat" "%TorDownloadUrl%" "%EnvDownloadPath%\%TorInstall%"
if not exist "%EnvDownloadPath%\%TorInstall%" %cecho% error "Cannot download Tor installation" & goto error
%cecho% info "Unpack Tor"
"%EnvSevenZipExe%" x -o"%EnvTorPath%" "%EnvDownloadPath%\%TorInstall%"
)
:exit
endlocal
exit /B 0
:error
call "%ToolsPath%\remove-dir.bat" "%EnvTempPath%"
endlocal
exit /B 1

View File

@ -1,5 +1,7 @@
!insertmacro LANG_STRING Section_Main "${APPNAME}"
!insertmacro LANG_STRING Section_Main_Desc "Instal·la ${APPNAME} i els components necessaris."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_Data "Pells"
!insertmacro LANG_STRING Section_Data_Desc "Instal·la pells."
!insertmacro LANG_STRING Section_Shortcuts "Icones d'accés directe"

View File

@ -1,5 +1,7 @@
!insertmacro LANG_STRING Section_Main "${APPNAME}"
!insertmacro LANG_STRING Section_Main_Desc "Installiert ${APPNAME} und die benötigten Komponenten."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installiert Tor."
!insertmacro LANG_STRING Section_Data "Skins"
!insertmacro LANG_STRING Section_Data_Desc "Skins installieren."
!insertmacro LANG_STRING Section_Shortcuts "Verknüpfungssymbole"

View File

@ -1,5 +1,7 @@
!insertmacro LANG_STRING Section_Main "${APPNAME}"
!insertmacro LANG_STRING Section_Main_Desc "Installs ${APPNAME} and required components."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_Data "Skins"
!insertmacro LANG_STRING Section_Data_Desc "Installs skins."
!insertmacro LANG_STRING Section_Shortcuts "Shortcut icons"

View File

@ -1,5 +1,7 @@
!insertmacro LANG_STRING Section_Main "${APPNAME}"
!insertmacro LANG_STRING Section_Main_Desc "Instala ${APPNAME} y los componentes requeridos."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_Data "Coberturas (skins)"
!insertmacro LANG_STRING Section_Data_Desc "Instalar coberturas"
!insertmacro LANG_STRING Section_Shortcuts "Iconos de accesos directos"

View File

@ -1,5 +1,7 @@
!insertmacro LANG_STRING Section_Main "${APPNAME}"
!insertmacro LANG_STRING Section_Main_Desc "Installe ${APPNAME} et les composants requis."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_Data "Habillages"
!insertmacro LANG_STRING Section_Data_Desc "Installe des habillages."
!insertmacro LANG_STRING Section_Shortcuts "Icônes de raccourci"

View File

@ -1,5 +1,7 @@
!insertmacro LANG_STRING Section_Main "${APPNAME}"
!insertmacro LANG_STRING Section_Main_Desc "Instaluje ${APPNAME} oraz wymagane komponenty."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_Data "Skórki"
!insertmacro LANG_STRING Section_Data_Desc "Instaluje skórki."
!insertmacro LANG_STRING Section_Shortcuts "Ikony skrótów"

View File

@ -1,5 +1,7 @@
!insertmacro LANG_STRING Section_Main "${APPNAME}"
!insertmacro LANG_STRING Section_Main_Desc "Установка ${APPNAME} и необходимых компонентов."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_Data "Оболочки"
!insertmacro LANG_STRING Section_Data_Desc "Установка оболочек."
!insertmacro LANG_STRING Section_Shortcuts "Ярлыки"

View File

@ -1,5 +1,7 @@
!insertmacro LANG_STRING Section_Main "${APPNAME}"
!insertmacro LANG_STRING Section_Main_Desc "${APPNAME} ve gerekli bileşenleri kurar."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_Data "Temalar"
!insertmacro LANG_STRING Section_Data_Desc "Tema yükleyin."
!insertmacro LANG_STRING Section_Shortcuts "Kısayol simgeleri"

View File

@ -8,6 +8,20 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Section_Tor</name>
<message>
<source>Tor</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Section_Tor_Desc</name>
<message>
<source>Installs Tor.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Section_Data</name>
<message>

View File

@ -1,5 +1,7 @@
!insertmacro LANG_STRING Section_Main "${APPNAME}"
!insertmacro LANG_STRING Section_Main_Desc "Installs ${APPNAME} and required components."
!insertmacro LANG_STRING Section_Tor "Tor"
!insertmacro LANG_STRING Section_Tor_Desc "Installs Tor."
!insertmacro LANG_STRING Section_Data "皮肤"
!insertmacro LANG_STRING Section_Data_Desc "安装皮肤"
!insertmacro LANG_STRING Section_Shortcuts "快捷方式图标"

View File

@ -56,7 +56,17 @@
!endif
# Date
!define /date Date "%Y%m%d"
!ifndef DATE
!define /date DATE "%Y%m%d"
!endif
# Tor
!ifdef TORDIR
${!defineifexist} TOR_EXISTS "${TORDIR}\tor.exe"
!ifndef TOR_EXISTS
!error "tor.exe not found"
!endif
!endif
# Application name and version
!define APPNAME "RetroShare"
@ -78,7 +88,7 @@
# Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-Qt-${QTVERSION}-${ARCHITECTURE}${INSTALLERADD}-setup.exe"
OutFile "${OUTDIR_}RetroShare-${VERSION}-${DATE}-${REVISION}-Qt-${QTVERSION}-${ARCHITECTURE}${INSTALLERADD}-setup.exe"
BrandingText "${APPNAMEANDVERSION}"
RequestExecutionlevel highest
# Use compression
@ -110,8 +120,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 +240,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
@ -271,6 +281,14 @@ Section $(Section_Main) Section_Main
File /r "${SOURCEDIR}\retroshare-gui\src\license\*.*"
SectionEnd
# Tor
!ifdef TOR_EXISTS
Section /o $(Section_Tor) Section_Tor
SetOutPath "$INSTDIR"
File /r "${TORDIR}\*"
SectionEnd
!endif
# Plugins
${!defineifexist} PLUGIN_FEEDREADER_EXISTS "${RELEASEDIR}\plugins\FeedReader\release\FeedReader.dll"
${!defineifexist} PLUGIN_VOIP_EXISTS "${RELEASEDIR}\plugins\VOIP\release\VOIP.dll"
@ -385,6 +403,7 @@ SectionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugin_VOIP} $(Section_Plugin_VOIP_Desc)
; !insertmacro MUI_DESCRIPTION_TEXT ${Section_Link} $(Section_Link_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_AutoStart} $(Section_AutoStart_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Tor} $(Section_Tor_Desc)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
# Uninstall

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

View File

@ -18,7 +18,7 @@ call "%~dp0find-in-path.bat" GitPath git.exe
if "%GitPath%"=="" (
echo.
echo Git executable not found in PATH.
goto exit
exit /B 1
)
set GitParameter=

View File

@ -0,0 +1,32 @@
REM Usage:
REM call get-rs-date.bat SourcePath Variable
setlocal
set SourcePath=%~1
set Variable=%~2
if "%Variable%"=="" (
echo.
echo Parameter error
exit /B 1
)
:: Check git executable
set GitPath=
call "%~dp0find-in-path.bat" GitPath git.exe
if "%GitPath%"=="" (
echo.
echo Git executable not found in PATH.
exit /B 1
)
set Date=
pushd "%SourcePath%"
rem This doesn't work: git log -1 --date=format:"%Y%m%d" --format="%ad"
for /F "tokens=1,2,3* delims=-" %%A in ('git log -1 --date^=short --format^="%%ad"') do set Date=%%A%%B%%C
popd
:exit
endlocal & set %Variable%=%Date%
exit /B 0