Index: scripts/internal/clear_env.bat =================================================================== diff -u -ref023462c3ce1007cc632af15c3913b69f267683 -r718a83fb4e17e7d6160fdbf11b154e2068278586 --- scripts/internal/clear_env.bat (.../clear_env.bat) (revision ef023462c3ce1007cc632af15c3913b69f267683) +++ scripts/internal/clear_env.bat (.../clear_env.bat) (revision 718a83fb4e17e7d6160fdbf11b154e2068278586) @@ -7,7 +7,7 @@ rem Setup environment if exist "%TmpDir%" ( - echo * Removing temporary directory... + echo * Removing temporary directory... cd "%TmpDir%\.." @@ -20,7 +20,7 @@ if NOT "%1" == "/skip_create" ( if exist "%OutputDir%" ( - echo * Removing OutputDirectory... + echo * Removing OutputDirectory... rmdir /S /Q "%OutputDir%" >nul if exist "%OutputDir%" ( echo ERROR: Deleting the old output folder failed. Index: scripts/internal/embed_srcserver_info.bat =================================================================== diff -u -r03340b954ead8138d669ee4f8df7124dc84c5612 -r718a83fb4e17e7d6160fdbf11b154e2068278586 --- scripts/internal/embed_srcserver_info.bat (.../embed_srcserver_info.bat) (revision 03340b954ead8138d669ee4f8df7124dc84c5612) +++ scripts/internal/embed_srcserver_info.bat (.../embed_srcserver_info.bat) (revision 718a83fb4e17e7d6160fdbf11b154e2068278586) @@ -7,7 +7,7 @@ goto end ) -SET MainProjectDir=%1 +SET MainProjectDir=%~1 call config.bat if errorlevel 1 ( @@ -19,41 +19,39 @@ goto error ) -for %%f in (%MainProjectDir%\src %MainProjectDir%\src\ictranslate %MainProjectDir%\src\libictranslate %MainProjectDir%\src\libicpf) do ( - echo * Processing source path %%f... - 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. See the log below: - type "%TmpDir%\command.log" - exit /b 1 - ) +SET _command=call svnindex.cmd /debug /source=%MainProjectDir%\src\ictranslate;%MainProjectDir%\src\libictranslate;%MainProjectDir%\src\libicpf;%MainProjectDir%\src /symbols=%MainProjectDir%\bin\release +!_command! >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: Error encountered while embedding source server information. See the log below: + type "%TmpDir%\command.log" + exit /b 1 +) - rem We expect at least one embedding to succeed per source path - SET IndexRes=Undefined - SET _command=type "%TmpDir%\command.log" - for /f %%a in ('!_command! ^| find /c "wrote"') do set IndexRes=%%a - if "!IndexRes!" == "0" ( - echo Some source server information has not been embedded. See the log below: - type "%TmpDir%\command.log" - exit /b 1 - ) +rem We expect all pdbs to be modified (currently 12 of them - 6/architecture) +SET IndexRes=Undefined +SET _command=type "%TmpDir%\command.log" +for /f %%a in ('!_command! ^| find /c "wrote"') do set IndexRes=%%a +if NOT "!IndexRes!" == "12" ( + echo Some source server information has not been embedded. See the log below: + type "%TmpDir%\command.log" + exit /b 1 +) - echo ...embedded information in !IndexRes! files. +echo ...embedded information in !IndexRes! files. +SET _command=type "%TmpDir%\command.log" +for /f %%a in ('!_command! ^| find /c "ERROR"') do set IndexRes=%%a +if NOT "!IndexRes!" == "0" ( + echo Error encountered when embedding source server information. See the log below: + type "%TmpDir%\command.log" + exit /b 1 +) - for /f %%a in ('!_command! ^| find /c "ERROR"') do set IndexRes=%%a - if NOT "!IndexRes!" == "0" ( - echo Error encountered when embedding source server information. See the log below: - type "%TmpDir%\command.log" - exit /b 1 - ) - - for /f %%a in ('!_command! ^| find /c "WARNING"') do set IndexRes=%%a - if NOT "!IndexRes!" == "0" ( - echo Error encountered when embedding source server information. See the log below: - type "%TmpDir%\command.log" - exit /b 1 - ) +SET _command=type "%TmpDir%\command.log" +for /f %%a in ('!_command! ^| find /c "WARNING"') do set IndexRes=%%a +if NOT "!IndexRes!" == "0" ( + echo Error encountered when embedding source server information. See the log below: + type "%TmpDir%\command.log" + exit /b 1 ) exit /b 0 Index: scripts/make_existing_release.bat =================================================================== diff -u -r03340b954ead8138d669ee4f8df7124dc84c5612 -r718a83fb4e17e7d6160fdbf11b154e2068278586 --- scripts/make_existing_release.bat (.../make_existing_release.bat) (revision 03340b954ead8138d669ee4f8df7124dc84c5612) +++ scripts/make_existing_release.bat (.../make_existing_release.bat) (revision 718a83fb4e17e7d6160fdbf11b154e2068278586) @@ -85,6 +85,24 @@ echo * Preparing the symbols package... +cd %MainProjectDir%\scripts +if "%CHCustomVersion%" == "1" ( + if "%CHReleaseType%" == "internal" ( + echo * WARNING: Skipping embedding source server info in PDB files due to local sources modifications... + ) else ( + echo * ERROR: Tagged sources contains local modifications - cannot embed source server info in PDB files... + goto error + ) +) else ( + echo * Embedding source server info in PDB files... + 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 + ) +) + cd %MainProjectDir% if not exist bin\release ( echo ERROR: The bin\release directory does not exist. @@ -93,16 +111,6 @@ cd %MainProjectDir%\bin\release -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: @@ -179,10 +187,12 @@ goto cleanup :error +echo * Clearing environment... call internal\clear_env.bat /skip_create exit /b 1 :cleanup +echo * Clearing environment... call internal\clear_env.bat /skip_create :end