Merged PR 7168453: Fix Razzle build breaks due to build analyzer complaining about temporary files

Fix Razzle build breaks due to build analyzer complaining about temporary files
This commit is contained in:
Mitch Lindgren 🦎 2022-04-01 23:39:38 +00:00
Родитель 0aa0f1e765
Коммит 75c23bfe2a
1 изменённых файлов: 18 добавлений и 15 удалений

Просмотреть файл

@ -1,5 +1,8 @@
@echo on
set TmpBuildInfoFile=%temp%\symcrypt-build-tmp.txt
set TmpBuildStringFile=%temp%\symcrypt-build-string.txt
@rem We'll probably rename the version numbers to the new definition
call :GetVersionNumber SYMCRYPT_CODE_VERSION_API MajorVersionNumber
@ -11,21 +14,21 @@ call :GetDateTime DateTime
call :GetCommitInfo CommitInfo
echo // Build information. WARNING: automatically generated; DO NOT EDIT >tmp.txt
echo #define SYMCRYPT_BUILD_INFO_BRANCH "%BranchName%" >>tmp.txt
echo #define SYMCRYPT_BUILD_INFO_COMMIT "%CommitInfo%" >>tmp.txt
echo #define SYMCRYPT_BUILD_INFO_VERSION "%MajorVersionNumber%.%MinorVersionNumber%" >> tmp.txt
echo #define SYMCRYPT_BUILD_INFO_TIMESTAMP "%DateTime%" >>tmp.txt
echo // Build information. WARNING: automatically generated; DO NOT EDIT > %TmpBuildInfoFile%
echo #define SYMCRYPT_BUILD_INFO_BRANCH "%BranchName%" >> %TmpBuildInfoFile%
echo #define SYMCRYPT_BUILD_INFO_COMMIT "%CommitInfo%" >> %TmpBuildInfoFile%
echo #define SYMCRYPT_BUILD_INFO_VERSION "%MajorVersionNumber%.%MinorVersionNumber%" >> %TmpBuildInfoFile%
echo #define SYMCRYPT_BUILD_INFO_TIMESTAMP "%DateTime%" >> %TmpBuildInfoFile%
copy tmp.txt %OBJECT_ROOT%\SymCrypt\build\%O%\buildInfo.h
copy %TmpBuildInfoFile% %OBJECT_ROOT%\SymCrypt\build\%O%\buildInfo.h
type tmp.txt
type %TmpBuildInfoFile%
goto cleanup
:GetCommitInfo
git log -n 1 --date=iso-strict-local --format=%%cd_%%h >t.txt
set /p %1=<t.txt
git log -n 1 --date=iso-strict-local --format=%%cd_%%h >%TmpBuildStringFile%
set /p %1=<%TmpBuildStringFile%
goto :EOF
@ -34,8 +37,8 @@ set %1=%date:~-4%-%date:~-10,2%-%date:~-7,2%T%time:~,-3%
goto :EOF
:GetBranchName
git status | findstr /C:"On branch" >t.txt
set /P T=<t.txt
git status | findstr /C:"On branch" >%TmpBuildStringFile%
set /P T=<%TmpBuildStringFile%
for /f "tokens=3" %%i in ("%T%") do set %1=%%i
goto :EOF
@ -44,8 +47,8 @@ goto :EOF
@rem get into variable VersionNumber
@rem Extract the #define line from the version file
findstr define %SDXROOT%\SymCrypt\inc\symcrypt_internal_shared.inc | findstr %1 >t.txt
set /p T=<t.txt
findstr define %SDXROOT%\SymCrypt\inc\symcrypt_internal_shared.inc | findstr %1 >%TmpBuildStringFile%
set /p T=<%TmpBuildStringFile%
@rem Extract the last item
for /f "tokens=3" %%i in ("%T%") do set %2=%%i
@ -63,5 +66,5 @@ set MinorVersionNumber=
set BranchName=
set DateTime=
set CommitInfo=
del t.txt
del tmp.txt
del %TmpBuildStringFile%
del %TmpBuildInfoFile%