Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI-NO-BUILD] [build] Scrub the cleaners #1211

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 37 additions & 12 deletions Balloon/cleanAll.bat
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
@echo on
@echo off
set _cln_tgt_=Balloon
set _cln_subdirs_=app sys
call ..\build\clean.bat
call :subdir %_cln_subdirs_%
goto :eof

rmdir /S /Q Install

del /F *.log *.wrn *.err

cd app
call cleanAll.bat
cd ..

cd sys
call cleanAll.bat
cd ..
:subdir
if "%~1"=="" goto :eof
call :do_clean %1
shift
goto :subdir

:do_clean
echo Cleaning %_cln_tgt_% ^| %~1 ...
if not exist "%~dp0%~1" (
echo The %_cln_tgt_%^\%~1 directory was not available for cleaning.
goto :eof
)
pushd "%~dp0%~1"
if exist ".\cleanall.bat" (
call cleanall.bat
) else (
if exist ".\clean.bat" (
call clean.bat
) else (
if exist "..\..\build\clean.bat" (
call ..\..\build\clean.bat
) else (
if exist "..\..\..\build\clean.bat" (
call ..\..\..\build\clean.bat
) else (
echo A cleaner for the %_cln_tgt_%^\%~1 directory could not be found.
)
)
)
)
popd
goto :eof
17 changes: 1 addition & 16 deletions NetKVM/CoInstaller/clean.bat
Original file line number Diff line number Diff line change
@@ -1,17 +1,2 @@
@echo off
goto start
:rmdir
if exist "%~1" rmdir "%~1" /s /q
goto :eof

:rmfiles
if "%~1"=="" goto :eof
if exist "%~1" del "%~1"
shift
goto rmfiles

:start

call :rmdir x64
call :rmdir Win10Release
call :rmdir Win10Debug
call ..\..\build\clean.bat
19 changes: 1 addition & 18 deletions NetKVM/Mof/clean.bat
Original file line number Diff line number Diff line change
@@ -1,19 +1,2 @@
@echo off
goto start
:rmdir
if exist "%~1" rmdir "%~1" /s /q
goto :eof

:rmfiles
if "%~1"=="" goto :eof
if exist "%~1" del "%~1"
shift
goto rmfiles

:start

call :rmdir obj
call :rmdir Win32
call :rmdir x64

call :rmfiles ..\Common\netkvmmof.h netkvm.bmf
call ..\..\build\clean.bat
2 changes: 1 addition & 1 deletion NetKVM/NotifyObject/clean.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
for %%d in (x64 x86 arm64 install) do rmdir /q /s %%d
call ..\..\build\clean.bat
2 changes: 1 addition & 1 deletion NetKVM/ProtocolService/clean.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
for %%d in (x64 x86 arm64 Win32) do rmdir /q /s %%d
call ..\..\build\clean.bat
59 changes: 33 additions & 26 deletions NetKVM/clean.bat
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
@echo off

goto start
:rmdir
if exist "%~1" rmdir "%~1" /s /q
set _cln_tgt_=NetKVM
set _cln_subdirs_=CoInstaller Mof NotifyObject ProtocolService
call clean_dvl_log.cmd
call clean_inx.cmd
call ..\build\clean.bat
call :subdir %_cln_subdirs_%
goto :eof

:rmfiles
:subdir
if "%~1"=="" goto :eof
if exist "%~1" del /f "%~1"
call :do_clean %1
shift
goto rmfiles

:start
call clean_dvl_log.cmd
call :rmdir Install
call :rmdir Install_Debug
call :rmdir x64
call :rmdir x86
call :rmdir ARM64
call :rmdir codeql_db
call :rmfiles build.err build.log buildfre_*.log buildchk_*.log msbuild.log
call :rmfiles netkvm.DVL.XML netkvm.DVL-compat.XML SDV-default.xml sdv-user.sdv
call :rmfiles *.sarif codeql.build.bat
call :rmfiles *.inx

for %%d in (CoInstaller Mof NotifyObject ProtocolService) do call :subdir %%d
goto :eof
goto :subdir

:subdir
pushd %1
call clean.bat
:do_clean
echo Cleaning %_cln_tgt_% ^| %~1 ...
if not exist "%~dp0%~1" (
echo The %_cln_tgt_%^\%~1 directory was not available for cleaning.
goto :eof
)
pushd "%~dp0%~1"
if exist ".\cleanall.bat" (
call cleanall.bat
) else (
if exist ".\clean.bat" (
call clean.bat
) else (
if exist "..\..\build\clean.bat" (
call ..\..\build\clean.bat
) else (
if exist "..\..\..\build\clean.bat" (
call ..\..\..\build\clean.bat
) else (
echo A cleaner for the %_cln_tgt_%^\%~1 directory could not be found.
)
)
)
)
popd
goto :eof
36 changes: 31 additions & 5 deletions NetKVM/clean_dvl_log.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
setlocal
call ..\build\SetVsEnv.bat
rmdir /q /s sdv
msbuild.exe NetKVM-VS2015.vcxproj /t:clean /p:Configuration="Win10 Release" /P:Platform=x64
msbuild.exe NetKVM-VS2015.vcxproj /t:sdv /p:inputs="/clean" /p:Configuration="Win10 Release" /P:platform=x64
@echo off
if "%loglevel%"=="" (
if "%~1"=="-quiet" (set loglevel=0)
if "%~1"=="-debug" (set loglevel=2)
if "%~1"=="" (set loglevel=1)
)
if "%loglevel%"=="0" (
set _cln_verbs=quiet
call ..\build\SetVsEnv.bat > nul
)
if "%loglevel%"=="1" (
set _cln_verbs=normal
call ..\build\SetVsEnv.bat
)
if "%loglevel%"=="2" (
set _cln_verbs=detailed
call ..\build\SetVsEnv.bat
)
call :rmdir .\sdv
msbuild.exe NetKVM-VS2015.vcxproj /t:clean /p:Configuration="Win10 Release" /P:Platform=x64 -Verbosity:%_cln_verbs%
msbuild.exe NetKVM-VS2015.vcxproj /t:sdv /p:inputs="/clean" /p:Configuration="Win10 Release" /P:platform=x64 -Verbosity:%_cln_verbs%
endlocal
goto :eof

:rmdir
if exist "%~1" (
if %loglevel% NEQ 0 echo Removing %~1 directory tree...
rmdir "%~1" /s /q
) else (
if %loglevel% EQU 2 echo We did not find any %~1 directory tree to remove.
)
goto :eof
19 changes: 19 additions & 0 deletions NetKVM/clean_inx.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@echo off
if "%loglevel%"=="" (
if "%~1"=="-quiet" (set loglevel=0)
if "%~1"=="-debug" (set loglevel=2)
if "%~1"=="" (set loglevel=1)
)
call :rmfiles *.inx
goto :eof

:rmfiles
if "%~1"=="" goto :eof
if exist "%~1" (
if %loglevel% NEQ 0 echo Removing the %~1 file...
del /f "%~1"
) else (
if %loglevel% EQU 2 echo We did not find any %~1 file^(s^) to remove.
)
shift
goto rmfiles
4 changes: 2 additions & 2 deletions Q35/clean.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
if exist Install rmdir /s /q Install
if exist smbus.cat del /f /s /q smbus.cat
@echo off
call ..\build\clean.bat %*
6 changes: 1 addition & 5 deletions VirtIO/WDF/clean.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
@echo off

for /d %%x in (objfre_*) do rmdir /S /Q %%x
for /d %%x in (objchk_*) do rmdir /S /Q %%x

del /F *.log *.wrn *.err
call ..\..\build\clean.bat
44 changes: 37 additions & 7 deletions VirtIO/clean.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@
for /d %%x in (objfre_*) do rmdir /S /Q %%x
for /d %%x in (objchk_*) do rmdir /S /Q %%x
rmdir /S /Q x64
@echo off
set _cln_tgt_=VirtIO
set _cln_subdirs_=WDF
call ..\build\clean.bat
call :subdir %_cln_subdirs_%
goto :eof

del /F *.log *.wrn *.err
:subdir
if "%~1"=="" goto :eof
call :do_clean %1
shift
goto :subdir

cd WDF
call clean.bat
cd ..
:do_clean
echo Cleaning %_cln_tgt_% ^| %~1 ...
if not exist "%~dp0%~1" (
echo The %_cln_tgt_%^\%~1 directory was not available for cleaning.
goto :eof
)
pushd "%~dp0%~1"
if exist ".\cleanall.bat" (
call cleanall.bat
) else (
if exist ".\clean.bat" (
call clean.bat
) else (
if exist "..\..\build\clean.bat" (
call ..\..\build\clean.bat
) else (
if exist "..\..\..\build\clean.bat" (
call ..\..\..\build\clean.bat
) else (
echo A cleaner for the %_cln_tgt_%^\%~1 directory could not be found.
)
)
)
)
popd
goto :eof
43 changes: 36 additions & 7 deletions build/clean.bat
Original file line number Diff line number Diff line change
@@ -1,27 +1,56 @@
@echo off
if "%loglevel%"=="" (
if "%~1"=="-quiet" (set loglevel=0)
if "%~1"=="-debug" (set loglevel=2)
if "%~1"=="" (set loglevel=1)
)

for /D %%D IN (objchk_*) do call :rmdir %%D
for /D %%D IN (objfre_*) do call :rmdir %%D
for /D %%D IN (objchk_*) do @call :rmdir %%D
for /D %%D IN (objfre_*) do @call :rmdir %%D

call :rmdir .\Install
call :rmdir .\Release
call :rmdir .\Debug
call :rmdir .\Install_Debug
call :rmdir .\Win10Release
call :rmdir .\Win10Debug
call :rmdir .\Win11Release
call :rmdir .\Win11Debug
call :rmdir .\ARM64
call :rmdir .\Win32
call :rmdir .\x64

call :rmdir .\x86
call :rmdir .\obj
call :rmdir .\sdv
call :rmdir .\sdv.temp
call :rmdir .\codeql_db
call :rmfiles *.dvl.xml *.dvl-compat.xml
call :rmfiles *.dvl.xml *.dvl-compat.xml *.dvl-win1*.xml
call :rmfiles *.legacy_dvl_result.txt
call :rmfiles sdv-map.h sdv-user.sdv SDV-default.xml
call :rmfiles smvstats.txt smvbuild.log vc.nativecodeanalysis.all.xml
call :rmfiles *.sarif codeql.build.bat
call :rmfiles *.log *.wrn *.err
call :rmfiles build.sdv.config
call :rmfiles *.log *.wrn *.err *.sdf
call :rmfiles qemufwcfg.cat
call :rmfiles ..\Common\netkvmmof.h netkvm.bmf
goto :eof

:rmdir
if exist "%~1" rmdir "%~1" /s /q
if exist "%~1" (
if %loglevel% NEQ 0 echo Removing %~1 directory tree...
rmdir "%~1" /s /q
) else (
if %loglevel% EQU 2 echo We did not find any %~1 directory tree to remove.
)
goto :eof

:rmfiles
if "%~1"=="" goto :eof
if exist "%~1" del /f "%~1"
if exist "%~1" (
if %loglevel% NEQ 0 echo Removing the %~1 file...
del /f "%~1"
) else (
if %loglevel% EQU 2 echo We did not find any %~1 file^(s^) to remove.
)
shift
goto rmfiles
Loading