Index: scripts/config.bat =================================================================== diff -u -N -r879a575c6688f971eb22fdfbefdd76aee4b69fac -r03340b954ead8138d669ee4f8df7124dc84c5612 --- scripts/config.bat (.../config.bat) (revision 879a575c6688f971eb22fdfbefdd76aee4b69fac) +++ scripts/config.bat (.../config.bat) (revision 03340b954ead8138d669ee4f8df7124dc84c5612) @@ -5,10 +5,16 @@ SET CurrentDir=%CD% SET ScriptDir=%CurrentDir% +SET CHRootDir=%CurrentDir%\.. SET OutputDir=%CurrentDir%\out SET TmpDir=%CurrentDir%\tmp -SET MainProjectDir=%TmpDir%\copyhandler +SET VSInstallDirX64=%ProgramFiles%\Microsoft Visual Studio 9.0 + +rem NOTE: Strange construct here because of strange behaviour of %ProgramFiles(x86)% which loses last parenthesis otherwise +if "%ProgramFiles(x86)%" == "" SET VSInstallDirX86=%ProgramFiles%\Microsoft Visual Studio 9.0 +if NOT "%ProgramFiles(x86)%" == "" SET VSInstallDirX86=%ProgramFiles(x86)%\Microsoft Visual Studio 9.0 + if not exist "%ScriptDir%\config.bat" ( echo ERROR: This script needs to be called from its directory. exit /b 1 Index: scripts/internal/detect_internal_version.bat =================================================================== diff -u -N -r6ee1dfea13b6871982655b160a571b78ff2e924e -r03340b954ead8138d669ee4f8df7124dc84c5612 --- scripts/internal/detect_internal_version.bat (.../detect_internal_version.bat) (revision 6ee1dfea13b6871982655b160a571b78ff2e924e) +++ scripts/internal/detect_internal_version.bat (.../detect_internal_version.bat) (revision 03340b954ead8138d669ee4f8df7124dc84c5612) @@ -1,58 +1,156 @@ @echo off -rem setlocal ENABLEDELAYEDEXPANSION +setlocal ENABLEDELAYEDEXPANSION rem Validate input parameters if [%1] == [] ( echo Usage: detect_version_internal.bat path goto end ) -echo * Scanning directory for version number +echo * Detecting type of the working copy +set _svn_info=svn info "%1" +for /f "delims=" %%a in ('!_svn_info! ^|find "URL"') do set _SVNUrl=%%a +if errorlevel 1 ( + echo Problem with retrieving working copy URL. + goto error +) + +if NOT "!_SVNUrl!" == "!_SVNUrl:trunk=dummy!" ( + SET _ReleaseType=internal +) else if NOT "!_SVNUrl!" == "!_SVNUrl:tags=dummy!" ( + SET _ReleaseType=tag +) else ( + echo Cannot detect type of the working copy. Directory not under version control system? + exit /b 1 +) + +rem In case of tagged releases we scan working copy for revision number only to get the modification flag +echo * Scanning svn working copy for revision number rem Get SVN version -SET _ver_cmd=svnversion -n "%1" -for /f %%a in ('%_ver_cmd%') do set SVNVersion=%%a +SET _svn_version=svnversion -n "%1" +for /f %%a in ('!_svn_version!') do set _SVNCalculatedVersion=%%a if errorlevel 1 ( echo Problem with scanning svn WC for current version. goto error ) -if "%SVNVersion%" == "" ( +if "!_SVNCalculatedVersion!" == "" ( echo Can't get the major version. goto error ) -echo * Detecting version numbers +rem Which format does svn version have? +rem When version contain colon, then take only the newer revision from it +if NOT "!_SVNCalculatedVersion!" == "!_SVNCalculatedVersion::=dummy!" ( + SET _SVNCalculatedVersion=!_SVNCalculatedVersion:*:=! +) + +rem If svn version contains S (switched), then just ignore this char +if NOT "!_SVNCalculatedVersion!" == "!_SVNCalculatedVersion:S=dummy!" ( + SET _SVNCalculatedVersion=!_SVNCalculatedVersion:S=! +) + +rem If we have only partial working copy (P), then fail +if NOT "!_SVNCalculatedVersion!" == "!_SVNCalculatedVersion:P=dummy!" ( + echo Only partial working copy detected - cannot detect version. + goto error +) + +rem If we have local modifications, then remember it, so we can modify the version number/string later +if NOT "!_SVNCalculatedVersion!" == "!_SVNCalculatedVersion:M=dummy!" ( + SET _SVNCalculatedVersion=!_SVNCalculatedVersion:M=! + SET _SVNIsModified=1 +) else ( + SET _SVNIsModified=0 +) + +echo * Detecting version numbers contained in version.h set _ver_cmd=type "%1\src\common\version.h" -for /f "tokens=3 delims= " %%a in ('%_ver_cmd% ^|find "define PRODUCT_VERSION1 "') do set MajorVersion=%%a + +for /f "tokens=3 delims= " %%a in ('!_ver_cmd! ^|find "define PRODUCT_VERSION1 "') do set _MajorVersion=%%a if errorlevel 1 ( - echo Problem with retrieving MajorVersion. + echo Problem with retrieving _MajorVersion. goto error ) -if "%MajorVersion%" == "" ( +if "!_MajorVersion!" == "" ( echo Can't get the major version. goto error ) set _ver_cmd=type "%1\src\common\version.h" -for /f "tokens=3 delims= " %%a in ('%_ver_cmd% ^|find "define PRODUCT_VERSION2 "') do set MinorVersion=%%a +for /f "tokens=3 delims= " %%a in ('!_ver_cmd! ^|find "define PRODUCT_VERSION2 "') do set _MinorVersion=%%a if errorlevel 1 ( - echo Problem with retrieving MinorVersion. + echo Problem with retrieving _MinorVersion. goto error ) -if "%MinorVersion%" == "" ( +if "!_MinorVersion!" == "" ( echo Can't get the major version. goto error ) -SET CustomVersion=1 +if "!_ReleaseType!" == "tag" ( + rem If handling the tagged revision, overwrite !_SVNVersion!, %_CustomVersion% and !_TextVersion! with the values contained in version.h + set _ver_cmd2=type "%1\src\common\version.h" + for /f "tokens=3 delims= " %%a in ('!_ver_cmd2! ^|find "define PRODUCT_VERSION3 "') do set _SVNVersion=%%a + if errorlevel 1 ( + echo Problem with retrieving svn version. + goto error + ) + if "!_SVNVersion!" == "" ( + echo Can't get the svn version. + goto error + ) + + set _ver_cmd2=type "%1\src\common\version.h" + for /f "tokens=3 delims= " %%a in ('!_ver_cmd2! ^|find "define PRODUCT_VERSION4 "') do set _CustomVersion=%%a + if errorlevel 1 ( + echo Problem with retrieving custom version. + goto error + ) + if "!_CustomVersion!" == "" ( + echo Can't get the custom version. + goto error + ) -SET TextVersion=%MajorVersion%.%MinorVersion%internal-svn%SVNVersion% -if "%TextVersion%" == "" ( - echo Cannot calculate the text version. - goto error + set _ver_cmd2=type "%1\src\common\version.h" + for /f "tokens=3 delims= " %%a in ('!_ver_cmd2! ^|find "define PRODUCT_VERSION "') do set _TextVersion=%%a + if errorlevel 1 ( + echo Problem with retrieving text version. + goto error + ) + if "!_TextVersion!" == "" ( + echo Can't get the text version. + goto error + ) + + rem Get rid of the '"' characters from the _TextVersion + if "!_SVNIsModified!" == "0" ( + SET _TextVersion=!_TextVersion:"=! + ) else ( + SET _TextVersion=!_TextVersion:"=!_M + ) +) else ( + SET _SVNVersion=!_SVNCalculatedVersion! + rem For internal version we format the text version on our own + if "!_SVNIsModified!" == "0" ( + SET _TextVersion=!_MajorVersion!.!_MinorVersion!internal-svn!_SVNVersion! + ) else ( + SET _TextVersion=!_MajorVersion!.!_MinorVersion!internal-svn!_SVNVersion!_M + ) + + if "!_TextVersion!" == "" ( + echo Cannot calculate the text version. + goto error + ) ) -echo * Detected current trunk at %MajorVersion%.%MinorVersion%.%SVNVersion%.%CustomVersion% +rem Overwrite %_CustomVersion% with !_SVNIsModified! +SET _CustomVersion=!_SVNIsModified! + +endlocal & call SET CHMajorVersion=%_MajorVersion%& SET CHMinorVersion=%_MinorVersion%& SET CHSVNVersion=%_SVNVersion%& SET CHCustomVersion=%_CustomVersion%& SET CHTextVersion=%_TextVersion%& SET CHReleaseType=%_ReleaseType% + +echo * Detected current working copy (%CHReleaseType%) at %CHMajorVersion%.%CHMinorVersion%.%CHSVNVersion%.%CHCustomVersion% (%CHTextVersion%) + goto end :error Index: scripts/internal/detect_version.bat =================================================================== diff -u -N --- scripts/internal/detect_version.bat (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) +++ scripts/internal/detect_version.bat (revision 0) @@ -1,95 +0,0 @@ -@echo off - -rem Include config -call config.bat -if errorlevel 1 ( - exit /b 1 -) - -rem Validate input parameters -if "%1" == "" ( - echo Usage: script beta^|final - goto end -) - -echo * Cleaning environment -call internal\clear_env.bat -if errorlevel 1 ( - echo ERROR: Problem with preparing environment. - goto error -) - -echo * Checking out '/trunk/src/common' directory of CH -svn co "%ReposCH%/trunk/src/common" "%MainProjectDir%" >"%TmpDir%\command.log" -if errorlevel 1 ( - echo Cannot retrieve the part of copy handler sources to establish svn version. See the log below: - type "%TmpDir%\command.log" - goto error -) - -echo * Scanning directory for version number -rem Get SVN version +2 to correct the nearest commit -set _ver_cmd=svnversion -n "%MainProjectDir%" -for /f %%a in ('%_ver_cmd%') do set /a TrunkSVNVersion=%%a -if errorlevel 1 ( - echo Problem with scanning svn WC for current version. - goto error -) -if "%TrunkSVNVersion%" == "" ( - echo Can't get the major version. - goto error -) - -SET /a SVNVersion=%TrunkSVNVersion%+2 - -echo * Detecting version numbers -set _ver_cmd=type "%MainProjectDir%\version.h" -for /f "tokens=3 delims= " %%a in ('%_ver_cmd% ^|find "define PRODUCT_VERSION1 "') do set MajorVersion=%%a -if errorlevel 1 ( - echo Problem with retrieving MajorVersion. - goto error -) -if "%MajorVersion%" == "" ( - echo Can't get the major version. - goto error -) - -set _ver_cmd=type "%MainProjectDir%\version.h" -for /f "tokens=3 delims= " %%a in ('%_ver_cmd% ^|find "define PRODUCT_VERSION2 "') do set MinorVersion=%%a -if errorlevel 1 ( - echo Problem with retrieving MinorVersion. - goto error -) -if "%MinorVersion%" == "" ( - echo Can't get the major version. - goto error -) - -SET CustomVersion=0 - -if "%1" == "beta" ( - SET TrunkTextVersion=%MajorVersion%.%MinorVersion%beta-svn%TrunkSVNVersion% - SET TextVersion=%MajorVersion%.%MinorVersion%beta-svn%SVNVersion% -) else ( - SET TrunkTextVersion=%MajorVersion%.%MinorVersion%Final - SET TextVersion=%MajorVersion%.%MinorVersion%Final -) - -if "%TextVersion%" == "" ( - echo Cannot calculate the text version. - goto error -) - -echo * Detected current trunk at %MajorVersion%.%MinorVersion%.%TrunkSVNVersion%.%CustomVersion%, preparing to tag as %MajorVersion%.%MinorVersion%.%SVNVersion%.%CustomVersion% -goto cleanup - -:error -rem Get outside of the temp directory to be able to delete it -call internal\clear_env.bat /skip_create -exit /b 1 - -:cleanup -call internal\clear_env.bat /skip_create - -:end -exit /b 0 Index: scripts/internal/embed_srcserver_info.bat =================================================================== diff -u -N -r2bcf2d927fb2138f152beab66f1e3f98d62c3fd5 -r03340b954ead8138d669ee4f8df7124dc84c5612 --- scripts/internal/embed_srcserver_info.bat (.../embed_srcserver_info.bat) (revision 2bcf2d927fb2138f152beab66f1e3f98d62c3fd5) +++ scripts/internal/embed_srcserver_info.bat (.../embed_srcserver_info.bat) (revision 03340b954ead8138d669ee4f8df7124dc84c5612) @@ -2,6 +2,13 @@ setlocal ENABLEDELAYEDEXPANSION +if "%1" == "" ( + echo Usage: embed_srcserver_info.bat path_to_sources + goto end +) + +SET MainProjectDir=%1 + call config.bat if errorlevel 1 ( exit /b 1 @@ -17,7 +24,8 @@ SET _command=call svnindex.cmd /debug /source=%%f /symbols=%MainProjectDir%\bin\release !_command! >"%TmpDir%\command.log" if errorlevel 1 ( - echo ERROR: Error encountered while embedding source server information. + echo ERROR: Error encountered while embedding source server information. See the log below: + type "%TmpDir%\command.log" exit /b 1 ) Index: scripts/internal/svntag.bat =================================================================== diff -u -N --- scripts/internal/svntag.bat (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) +++ scripts/internal/svntag.bat (revision 0) @@ -1,91 +0,0 @@ -@echo off - -rem Mark the changes as local ones -setlocal - -if [%1] == [] ( - echo Usage: svntag.bat TextVersion - exit /b 1 -) - -SET TextVersion=%1 - -rem Include config -call config.bat -if errorlevel 1 ( - exit /b 1 -) - -call internal\clear_env.bat -if errorlevel 1 ( - echo ERROR: Problem with preparing environment. - goto error -) - -echo * Tagging projects... -call internal\svntag_single.bat "%ReposIcpf%" %TextVersion% -if errorlevel 1 ( - goto error -) - -call internal\svntag_single.bat "%ReposIctranslate%" %TextVersion% -if errorlevel 1 ( - goto error -) - -call internal\svntag_single.bat "%ReposCH%" %TextVersion% -if errorlevel 1 ( - goto error -) - -echo * Checking out the tagged ch repository... -svn --ignore-externals co "%ReposCH%/tags/%TextVersion%" "%MainProjectDir%" >"%TmpDir%\command.log" -if errorlevel 1 ( - echo ERROR: encountered a problem while checking out copyhandler project. See the log below: - type "%TmpDir%\command.log" - goto error -) - -echo * Creating new svn:externals definition... - -echo src/libicpf %ReposIcpf%/tags/%TextVersion%/src/libicpf >"%TmpDir%\externals.txt" -echo src/libictranslate %ReposIctranslate%/tags/%TextVersion%/src/libictranslate >>"%TmpDir%\externals.txt" -echo src/rc2lng %ReposIctranslate%/tags/%TextVersion%/src/rc2lng >>"%TmpDir%\externals.txt" -echo src/ictranslate %ReposIctranslate%/tags/%TextVersion%/src/ictranslate >>"%TmpDir%\externals.txt" - -svn propedit --editor-cmd "type %TmpDir%\externals.txt >" svn:externals "%MainProjectDir%" >"%TmpDir%\command.log" -if errorlevel 1 ( - echo ERROR: encountered a problem while checking out copyhandler project. See the log below: - type "%TmpDir%\command.log" - goto error -) - -echo * Updating version information... -cscript //NoLogo internal\replace_version.vbs "%MainProjectDir%\src\common\version.h.template" "%MainProjectDir%\src\common\version.h" %MajorVersion% %MinorVersion% %SVNVersion% %CustomVersion% %TextVersion% >"%TmpDir%\command.log" -if errorlevel 1 ( - echo ERROR: encountered a problem while checking out copyhandler project. See the log below: - type "%TmpDir%\command.log" - goto error -) - -echo * Performing commit of the updated svn:externals... -svn commit -m "Updated svn:externals definition" "%MainProjectDir%" >"%TmpDir%\command.log" -if errorlevel 1 ( - echo ERROR: encountered a problem while committing changes to repository. See the log below: - type "%TmpDir%\command.log" - goto error -) - -goto cleanup - -:error -call internal\clear_env.bat /skip_create - -exit /b 1 - -:cleanup -echo * Cleaning up the temporary files... -call internal\clear_env.bat /skip_create - -:end -exit /b 0 Index: scripts/internal/svntag_single.bat =================================================================== diff -u -N -r0dad97fd1b1e4c79c037b3b638181c2214c0d8f8 -r03340b954ead8138d669ee4f8df7124dc84c5612 --- scripts/internal/svntag_single.bat (.../svntag_single.bat) (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) +++ scripts/internal/svntag_single.bat (.../svntag_single.bat) (revision 03340b954ead8138d669ee4f8df7124dc84c5612) @@ -1,5 +1,7 @@ @echo off +setlocal + if [%1] == [] ( echo Usage: svntag_single.bat ReposAddress TextVersion exit /b 1 @@ -13,13 +15,18 @@ exit /b 1 ) -call internal\clear_env.bat -if errorlevel 1 ( - exit /b 1 +rem partial cleanup +SET CHTmpDir=%TmpDir%\repo-tag-test +if exist "%CHTmpDir%" ( + rmdir /S /Q "%CHTmpDir%" >nul + if exist "%CHTmpDir%" ( + echo ERROR: Deleting the old temporary folder failed. + exit /b 1 + ) ) rem check if the project isn't already tagged -svn co "%ReposAddress%/tags/%TextVersion%" "%MainProjectDir%" 2>nul +svn co "%ReposAddress%/tags/%TextVersion%" "%CHTmpDir%" 2>nul if errorlevel 1 ( rem when error, it probably means that the tag does not exist goto create @@ -33,7 +40,7 @@ echo * Tagging %ReposAddress% as %TextVersion%... svn cp -m "Tagged project to %TextVersion%" "%ReposAddress%/trunk/" "%ReposAddress%/tags/%TextVersion%" >"%TmpDir%\command.log" if errorlevel 1 ( - echo ERROR: encountered a problem while tagging libicpf project. See the log below: + echo ERROR: encountered a problem while tagging %ReposAddress% project. See the log below: type "%TmpDir%\command.log" exit /b 1 ) Index: scripts/internal/symsrv_add_single_package.bat =================================================================== diff -u -N --- scripts/internal/symsrv_add_single_package.bat (revision 0) +++ scripts/internal/symsrv_add_single_package.bat (revision 03340b954ead8138d669ee4f8df7124dc84c5612) @@ -0,0 +1,71 @@ +@echo off + +rem Mark the changes as local ones +setlocal + +if [%1] == [] ( + echo "Usage: symsrv.bat package_path symsrv_path" + goto end +) + +if [%2] == [] ( + echo "Usage: symsrv.bat package_path symsrv_path" + goto end +) + +echo --- Initializing ----------------------------------------------- +echo * Reading configuration... +call config.bat +if errorlevel 1 ( + goto error +) +echo * Preparing environment... +call internal\prepare_env.bat +if errorlevel 1 ( + goto error +) + +echo --- Processing files -------------------------------------------- +echo * Extracting files... + +SET OutDir=%TmpDir%\symbols +if exist "%OutDir%" ( + rmdir /S /Q "%OutDir%" >nul + if exist "%OutDir%" ( + echo ERROR: Deleting the temporary folder failed. + exit /b 1 + ) +) + +mkdir "%OutDir%" +if errorlevel 1 ( + echo ERROR: Creating temporary directory failed. + goto error +) + +rem Unpack archive +7z x -o%OutDir% %1 >nul +if errorlevel 1 ( + echo ERROR: Unpacking archive failed. + goto error +) + +echo * Adding files to symbol server directory... + +symstore add /r /f "%OutDir%" /s "%2" /t "Copy Handler" /v "%1" +if errorlevel 1 ( + echo ERROR: Storing symbols failed. + goto error +) + +echo * Cleaning up files... +rmdir /S /Q "%OutDir%" + +echo * Done + +goto end + +:error +echo * Error processing files. + +:end Index: scripts/symsrv_add_single_package.bat =================================================================== diff -u -N --- scripts/symsrv_add_single_package.bat (revision 0d1107f10035b7e15d73aa0996d7deaf664041fc) +++ scripts/symsrv_add_single_package.bat (revision 0) @@ -1,71 +0,0 @@ -@echo off - -rem Mark the changes as local ones -setlocal - -if [%1] == [] ( - echo "Usage: symsrv.bat package_path symsrv_path" - goto end -) - -if [%2] == [] ( - echo "Usage: symsrv.bat package_path symsrv_path" - goto end -) - -echo --- Initializing ----------------------------------------------- -echo * Reading configuration... -call config.bat -if errorlevel 1 ( - goto error -) -echo * Preparing environment... -call internal\prepare_env.bat -if errorlevel 1 ( - goto error -) - -echo --- Processing files -------------------------------------------- -echo * Extracting files... - -SET OutDir=%TmpDir%\symbols -if exist "%OutDir%" ( - rmdir /S /Q "%OutDir%" >nul - if exist "%OutDir%" ( - echo ERROR: Deleting the temporary folder failed. - exit /b 1 - ) -) - -mkdir "%OutDir%" -if errorlevel 1 ( - echo ERROR: Creating temporary directory failed. - goto error -) - -rem Unpack archive -7z x -o%OutDir% %1 >nul -if errorlevel 1 ( - echo ERROR: Unpacking archive failed. - goto error -) - -echo * Adding files to symbol server directory... - -symstore add /r /f "%OutDir%" /s "%2" /t "Copy Handler" /v "%1" -if errorlevel 1 ( - echo ERROR: Storing symbols failed. - goto error -) - -echo * Cleaning up files... -rmdir /S /Q "%OutDir%" - -echo * Done - -goto end - -:error -echo * Error processing files. - -:end Index: scripts/make_existing_release.bat =================================================================== diff -u -N -r6ee1dfea13b6871982655b160a571b78ff2e924e -r03340b954ead8138d669ee4f8df7124dc84c5612 --- scripts/make_existing_release.bat (.../make_existing_release.bat) (revision 6ee1dfea13b6871982655b160a571b78ff2e924e) +++ scripts/make_existing_release.bat (.../make_existing_release.bat) (revision 03340b954ead8138d669ee4f8df7124dc84c5612) @@ -1,17 +1,11 @@ @echo off +rem Script prepares all packages based on the source code in which this script is placed. + rem Mark the changes as local ones setlocal ENABLEDELAYEDEXPANSION -rem Check input parameter -if [%1] == [] ( - echo Usage: make_package.bat TextVersion - exit /b 1 -) - -SET TextVersion=%1 - -echo --- Initializing ---------------------------------------------- +echo --- Initializing ---------------------------------------------------- call config.bat if errorlevel 1 ( exit /b 1 @@ -31,81 +25,64 @@ call "%VS90COMNTOOLS%\vsvars32.bat" >nul ) -SET VSInst=%ProgramFiles% -if NOT "%ProgramFiles(x86)%" == "" SET VSInst=%ProgramFiles(x86)% +set MainProjectDir=%CHRootDir% -echo --- Preparing source package ---------------------------------------- -if "%TextVersion%" == "trunk" ( - echo * Retrieving source code from trunk... - svn co "%ReposCH%/trunk" "%MainProjectDir%" >"%TmpDir%\command.log" 2>"%TmpDir%\command-err.log" -) else ( - echo * Retrieving tagged source code... - svn co "%ReposCH%/tags/%TextVersion%" "%MainProjectDir%" >"%TmpDir%\command.log" 2>"%TmpDir%\command-err.log" -) +rem Update the version string in the version.h for trunk +echo * Detecting current version information... +call internal\detect_internal_version.bat "%MainProjectDir%" if errorlevel 1 ( - echo ERROR: encountered a problem while exporting sources from repository. See the log below: - type "%TmpDir%\command-err.log" goto error ) -SET _cmd=type "%TmpDir%\command-err.log" -for /f %%a in ('%_cmd% ^|find "Error"') do SET Res=%%a -if NOT "%Res%" == "" ( - echo ERROR: Encountered some problems while checking out CH. See below for details: - type "%TmpDir%\command-err.log" - goto error -) - -rem Update the version string in the version.h for trunk -if "%TextVersion%" == "trunk" ( - echo * Detecting internal version information... - call internal\detect_internal_version.bat "%MainProjectDir%" +if "%CHReleaseType%" == "internal" ( + echo * Updating version information in version.h for the internal release... + cscript //NoLogo internal\replace_version.vbs "%MainProjectDir%\src\common\version.h.template" "%MainProjectDir%\src\common\version.h" !CHMajorVersion! !CHMinorVersion! !CHSVNVersion! !CHCustomVersion! !CHTextVersion! >"%TmpDir%\command.log" if errorlevel 1 ( - goto error - ) - - echo * Updating version information... - cscript //NoLogo internal\replace_version.vbs "%MainProjectDir%\src\common\version.h.template" "%MainProjectDir%\src\common\version.h" !MajorVersion! !MinorVersion! !SVNVersion! !CustomVersion! !TextVersion! >"%TmpDir%\command.log" - if errorlevel 1 ( - echo ERROR: encountered a problem while checking out copyhandler project. See the log below: + echo ERROR: encountered a problem while updating version information. See the log below: type "%TmpDir%\command.log" goto error ) ) -echo * Create source package for version %TextVersion%... -cd %MainProjectDir% -7z a "%OutputDir%\chsrc-%TextVersion%.zip" -tzip -x^^!"scripts\*.bat" -xr^^!".svn" . >"%TmpDir%\command.log" -if errorlevel 1 ( - echo ERROR: Preparation of the sources failed. See the log below: - type "%TmpDir%\command.log" - goto error -) - echo --- Building solutions ---------------------------------------------- -echo * Building win32... +cd "%MainProjectDir%" +echo * Building win32 release solution... devenv ch.vc90.sln /rebuild "Release-Unicode|Win32" >"%TmpDir%\command.log" if errorlevel 1 ( echo ERROR: Build process failed. See the log below: type "%TmpDir%\command.log" goto error ) -echo * Building win64... +echo * Building win64 release solution... devenv ch.vc90.sln /rebuild "Release-Unicode|x64" >"%TmpDir%\command.log" if errorlevel 1 ( echo ERROR: Build process failed. See the log below: type "%TmpDir%\command.log" goto error ) -echo * Embedding source server information to debug symbol files... -cd %ScriptDir% -call internal\embed_srcserver_info.bat +echo --- Preparing packages ---------------------------------------------- +echo * Create source package for version %CHTextVersion%... + +rem Export the current working copy to a separate directory to avoid including unnecessary files in the source archive +SET CHSrcDir="%TmpDir%\ch-src" +svn export "%MainProjectDir%" "%CHSrcDir%" >"%TmpDir%\command.log" 2>"%TmpDir%\command-err.log" if errorlevel 1 ( + echo ERROR: encountered a problem while exporting local sources to a separate location. See the log below: + type "%TmpDir%\command-err.log" goto error ) +cd %CHSrcDir% + +7z a "%OutputDir%\chsrc-%CHTextVersion%.zip" -tzip -x^^!"scripts\*.bat" -xr^^!".svn" . >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: Preparation of the sources failed. See the log below: + type "%TmpDir%\command.log" + goto error +) + echo * Preparing the symbols package... cd %MainProjectDir% @@ -116,7 +93,17 @@ cd %MainProjectDir%\bin\release -7z a "%OutputDir%\ch_symbols-%TextVersion%.zip" -tzip "*.pdb" >"%TmpDir%\command.log" +if "%CHReleaseType%" == "tag" ( + echo * Embedding svn paths in the debug symbols... + call internal\embed_srcserver_info.bat %MainProjectDir% + + if errorlevel 1 ( + echo ERROR: encountered a problem while embedding source server information in debug symbols. + goto error + ) +) + +7z a "%OutputDir%\ch_symbols-%CHTextVersion%.zip" -tzip "*.pdb" >"%TmpDir%\command.log" if errorlevel 1 ( echo ERROR: Could not create symbols archive. See the log below: type "%TmpDir%\command.log" @@ -151,9 +138,9 @@ xcopy "bin\release\libchcore32u.dll" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 xcopy "bin\release\libictranslate32u.dll" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 xcopy "bin\release\ictranslate.exe" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 -xcopy "%VSInst%\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 -xcopy "%VSInst%\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.MFC\*" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 -xcopy "%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\dbghelp.dll" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "%VSInstallDirX86%\VC\redist\x86\Microsoft.VC90.CRT\*" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "%VSInstallDirX86%\VC\redist\x86\Microsoft.VC90.MFC\*" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "%VSInstallDirX64%\Common7\IDE\Remote Debugger\x86\dbghelp.dll" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 xcopy /E /I "bin\release\help" "%TmpDir%\zip32\help" >>"%TmpDir%\command.log" || SET Res=1 xcopy /E /I "bin\release\langs" "%TmpDir%\zip32\langs" >>"%TmpDir%\command.log" || SET Res=1 @@ -164,9 +151,9 @@ xcopy "bin\release\libchcore64u.dll" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 xcopy "bin\release\libictranslate64u.dll" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 xcopy "bin\release\ictranslate64.exe" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 -xcopy "%VSInst%\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 -xcopy "%VSInst%\Microsoft Visual Studio 9.0\VC\redist\amd64\Microsoft.VC90.MFC\*" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 -xcopy "%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x64\dbghelp.dll" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "%VSInstallDirX86%\VC\redist\amd64\Microsoft.VC90.CRT\*" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "%VSInstallDirX86%\VC\redist\amd64\Microsoft.VC90.MFC\*" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "%VSInstallDirX64%\Common7\IDE\Remote Debugger\x64\dbghelp.dll" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 xcopy /E /I "bin\release\help" "%TmpDir%\zip64\help" >>"%TmpDir%\command.log" || SET Res=1 xcopy /E /I "bin\release\langs" "%TmpDir%\zip64\langs" >>"%TmpDir%\command.log" || SET Res=1 @@ -178,7 +165,7 @@ cd "%TmpDir%\" -7z a -tzip "%OutputDir%\ch-%TextVersion%.zip" zip32 zip64 >"%TmpDir%\command.log" +7z a -tzip "%OutputDir%\ch-%CHTextVersion%.zip" zip32 zip64 >"%TmpDir%\command.log" if errorlevel 1 ( echo ERROR: Could not create win32 zip archive. See the log below: type "%TmpDir%\command.log" Index: scripts/make_release.bat =================================================================== diff -u -N -re60da52f1dc714db5cbee292936365420e3364de -r03340b954ead8138d669ee4f8df7124dc84c5612 --- scripts/make_release.bat (.../make_release.bat) (revision e60da52f1dc714db5cbee292936365420e3364de) +++ scripts/make_release.bat (.../make_release.bat) (revision 03340b954ead8138d669ee4f8df7124dc84c5612) @@ -1,11 +1,13 @@ @echo off +rem Scripts checks out trunk or specific tag of CH and launches preparation of the packages for the retrieved version. + rem Mark the changes as local ones setlocal rem Check input parameter if [%1] == [] ( - echo Usage: make_package.bat beta^|final + echo Usage: make_release.bat ^ exit /b 1 ) @@ -22,31 +24,25 @@ goto error ) -echo --- Detecting version numbers ---------------------------------- -call internal\detect_version.bat %1 -if errorlevel 1 ( - goto error -) - -echo --- Checking if current trunk is already tagged ---------------- -svn --depth empty co "%ReposCH%/tags/%TrunkTextVersion%" "%MainProjectDir%" >nul 2>nul -if errorlevel 1 ( - echo * Tag not found. Will tag. +echo --- Retrieving code ---------------------------------- +if "%1" == "trunk" ( + SET CHRepositoryAddress=%ReposCH%/trunk ) else ( - echo * Tag %TrunkTextVersion% already found. Skipping tagging. - SET TextVersion=%TrunkTextVersion% - SET SVNVersion=%TrunkSVNVersion% - goto make_existing + SET CHRepositoryAddress=%ReposCH%/tags/%1 ) -echo --- Tagging the release ---------------------------------------- -call internal\svntag.bat %TextVersion% +echo * Checking out %CHRepositoryAddress%... +SET CHTmpDir=%TmpDir%\ch-svn +svn co "%CHRepositoryAddress%" "%CHTmpDir%" >"%TmpDir%\command.log" if errorlevel 1 ( + echo ERROR: Could not check out source code. See the log below: + type "%TmpDir%\command.log" goto error ) -:make_existing -call make_existing_release.bat %TextVersion% +rem call the original version of the script that was used to prepare the version (might not work for versions prior to 1.40) +ch %CHTmpDir%\scripts +call make_existing_release.bat if errorlevel 1 ( goto error ) Index: scripts/release_checklist.txt =================================================================== diff -u -N -re34e5d20b829fb1fbf24378f4c36f6dafde031c8 -r03340b954ead8138d669ee4f8df7124dc84c5612 --- scripts/release_checklist.txt (.../release_checklist.txt) (revision e34e5d20b829fb1fbf24378f4c36f6dafde031c8) +++ scripts/release_checklist.txt (.../release_checklist.txt) (revision 03340b954ead8138d669ee4f8df7124dc84c5612) @@ -1,7 +1,8 @@ 1. Commit new translation from forum to svn repository -2. Build packages with release - installer, zip, sources, symbols (scripted: make_release.bat) +2. Tag the trunk (svntag.bat) +2. Build packages with release - installer, zip, sources, symbols (scripted: make_existing_release.bat) 3. Post-build checks (is everything ok? does it install?) -4. Upload files to the sourceforge.net (scripted: upload_release.bat) +4. Upload files to the sourceforge.net (scripted: upload_release.bat (might not work due to the sf.net changes to upload system made a while ago)) 5. Prepare human readable changelog 6. Create new site story with changelog (en + pl). 7. Add new sf.net release, set release notes and changelog links. Index: scripts/setup.iss =================================================================== diff -u -N -r2e7f9b1a788561aaedff460158f992fda0838e36 -r03340b954ead8138d669ee4f8df7124dc84c5612 --- scripts/setup.iss (.../setup.iss) (revision 2e7f9b1a788561aaedff460158f992fda0838e36) +++ scripts/setup.iss (.../setup.iss) (revision 03340b954ead8138d669ee4f8df7124dc84c5612) @@ -156,3 +156,7 @@ end; end; end; + +[InnoIDE_Settings] +LogFileOverwrite=false + Index: scripts/svntag.bat =================================================================== diff -u -N --- scripts/svntag.bat (revision 0) +++ scripts/svntag.bat (revision 03340b954ead8138d669ee4f8df7124dc84c5612) @@ -0,0 +1,143 @@ +@echo off + +rem Mark the changes as local ones +setlocal + +if [%1] == [] ( + echo Usage: svntag.bat ^ + exit /b 1 +) + +rem This script wasn't tested yet (written 2011-10-22 23:04) +echo --- Initializing ---------------------------------------------------- + +rem Include config +call config.bat +if errorlevel 1 ( + exit /b 1 +) + +call internal\clear_env.bat +if errorlevel 1 ( + echo ERROR: Problem with preparing environment. + goto error +) + +rem checkout ch project (trunk) +echo * Retrieving trunk for CH... +SET CHTmpTrunkDir=%TmpDir%\ch-trunk +svn --ignore-externals co "%ReposCH%/trunk" "%CHTmpTrunkDir%" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: Cannot checkout trunk. See the log below: + type "%TmpDir%\command.log" + goto error +) + +rem detect version (for trunk it should get major.minor from version.h, svn rev from svn revision id) +echo * Detecting trunk version information... +call internal\detect_internal_version.bat "%CHTmpTrunkDir%" +if errorlevel 1 ( + goto error +) + +rem generate the tag to be created for sources +SET /a TagSVNRev=%CHSVNVersion%+2 +SET /a NewTrunkMinor=%CHMinorVersion%+1 +SET /a NewTrunkSVNRev=%TagSVNRev%+1 +SET NewTrunkTextTag=%CHMajorVersion%.%NewTrunkMinor%internal-svn%NewTrunkSVNRev% + +if "%1" == "Final" ( + SET TextTag=%CHMajorVersion%.%CHMinorVersion%Final +) else if "%1" == "Alpha" ( + SET TextTag=%CHMajorVersion%.%CHMinorVersion%Alpha-svn%TagSVNRev% +) else if "%1" == "Beta" ( + SET TextTag=%CHMajorVersion%.%CHMinorVersion%Beta-svn%TagSVNRev% +) else ( + echo ERROR: Unknown release type specified. + goto error +) + +echo * Tagging projects with %TextTag%... +call internal\svntag_single.bat "%ReposIcpf%" %TextTag% +if errorlevel 1 ( + goto error +) + +call internal\svntag_single.bat "%ReposIctranslate%" %TextTag% +if errorlevel 1 ( + goto error +) + +call internal\svntag_single.bat "%ReposCH%" %TextTag% +if errorlevel 1 ( + goto error +) + +echo * Checking out the tagged ch repository... +SET CHTmpTagDir=%TmpDir%\ch-tagged +svn --ignore-externals co "%ReposCH%/tags/%TextTag%" "%CHTmpTagDir%" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: encountered a problem while checking out copyhandler project. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Creating new svn:externals definition... + +echo src/libicpf %ReposIcpf%/tags/%TextTag%/src/libicpf >"%TmpDir%\externals.txt" +echo src/libictranslate %ReposIctranslate%/tags/%TextTag%/src/libictranslate >>"%TmpDir%\externals.txt" +echo src/rc2lng %ReposIctranslate%/tags/%TextTag%/src/rc2lng >>"%TmpDir%\externals.txt" +echo src/ictranslate %ReposIctranslate%/tags/%TextTag%/src/ictranslate >>"%TmpDir%\externals.txt" + +svn propedit --editor-cmd "type %TmpDir%\externals.txt >" svn:externals "%CHTmpTagDir%" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: encountered a problem while checking out copyhandler project. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Updating version information for tagged sources... +cscript //NoLogo internal\replace_version.vbs "%CHTmpTagDir%\src\common\version.h.template" "%CHTmpTagDir%\src\common\version.h" %CHMajorVersion% %CHMinorVersion% %TagSVNRev% 0 %TextTag% >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: encountered a problem while checking out copyhandler project. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Performing commit of the updated version and svn:externals... +svn commit -m "Updated svn:externals definition" "%CHTmpTagDir%" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: encountered a problem while committing changes to repository. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Updating version information for trunk sources (%NewTrunkTextTag%)... +cscript //NoLogo internal\replace_version.vbs "%CHTmpTrunkDir%\src\common\version.h.template" "%CHTmpTrunkDir%\src\common\version.h" %CHMajorVersion% %NewTrunkMinor% %NewTrunkSVNRev% 0 %NewTrunkTextTag% >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: encountered a problem while checking out copyhandler project. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Performing commit of the updated version... +svn commit -m "Automatic version bump after tagging %TextTag%" "%CHTmpTrunkDir%" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: encountered a problem while committing changes to repository. See the log below: + type "%TmpDir%\command.log" + goto error +) + +goto cleanup + +:error +call internal\clear_env.bat /skip_create + +exit /b 1 + +:cleanup +echo * Cleaning up the temporary files... +call internal\clear_env.bat /skip_create + +:end +exit /b 0 Index: scripts/symsrv_add_release.bat =================================================================== diff -u -N -r0d1107f10035b7e15d73aa0996d7deaf664041fc -r03340b954ead8138d669ee4f8df7124dc84c5612 --- scripts/symsrv_add_release.bat (.../symsrv_add_release.bat) (revision 0d1107f10035b7e15d73aa0996d7deaf664041fc) +++ scripts/symsrv_add_release.bat (.../symsrv_add_release.bat) (revision 03340b954ead8138d669ee4f8df7124dc84c5612) @@ -24,7 +24,7 @@ echo * Scanning directory %PackagesDir% for packages... for /R %PackagesDir% %%f in (*.zip) do ( echo * Processing package %%f... - call symsrv_add_single_package.bat "%%f" "%1" + call internal\symsrv_add_single_package.bat "%%f" "%1" if errorlevel 1 ( goto error )