Skip to content

Commit

Permalink
Skyline has at least one checked in devtools "bin" folder, don't stom…
Browse files Browse the repository at this point in the history
…p if contents are source controlled (#3239)

Refactored clean-apps.bat to preserve source controlled files in obj/ and bin/ subdirs that would formerly have been deleted, causing an annoying and unnecessary dirty repo situation.

Also, now cleaning everything under pwiz_tools/Shared instead of just selected subdirs of Shared - some subdirs have been recently added there without being noted in clean-apps.bat, and devs really shouldn't have to worry about that.

Internal build issue, not reported by any user
  • Loading branch information
bspratt authored Nov 26, 2024
1 parent a62a104 commit 0a4ff34
Showing 1 changed file with 32 additions and 11 deletions.
43 changes: 32 additions & 11 deletions pwiz_tools/clean-apps.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@ set PWIZ_ROOT=%PWIZ_ROOT:~0,-1%
pushd %PWIZ_ROOT%

echo Cleaning .NET applications...
for /d /r Shared\BiblioSpec %%d in (obj, bin) do @if exist "%%d" rmdir /s/q "%%d"
for /d /r Shared\Common %%d in (obj, bin) do @if exist "%%d" rmdir /s/q "%%d"
for /d /r Shared\CommonTest %%d in (obj, bin) do @if exist "%%d" rmdir /s/q "%%d"
for /d /r Shared\Crawdad %%d in (obj, bin) do @if exist "%%d" rmdir /s/q "%%d"
for /d /r Shared\MSGraph %%d in (obj, bin) do @if exist "%%d" rmdir /s/q "%%d"
for /d /r Shared\ProteomeDb %%d in (obj, bin) do @if exist "%%d" rmdir /s/q "%%d"
for /d /r Shared\ProteowizardWrapper %%d in (obj, bin) do @if exist "%%d" rmdir /s/q "%%d"
for /d /r Shared\zedgraph %%d in (obj, bin) do @if exist "%%d" rmdir /s/q "%%d"
for /d /r Skyline %%d in (obj, bin) do @if exist "%%d" rmdir /s/q "%%d"
for /d /r SeeMS %%d in (obj, bin) do @if exist "%%d" rmdir /s/q "%%d"
for /d /r MSConvertGUI %%d in (obj, bin) do @if exist "%%d" rmdir /s/q "%%d"
call :CleanBinaries Shared
call :CleanBinaries Skyline
call :CleanBinaries SeeMS
call :CleanBinaries MSConvertGUI

IF EXIST Shared\CommonTest rmdir /s/q Shared\CommonTest

Expand All @@ -27,3 +20,31 @@ IF EXIST Skyline\CleanSkyline.bat call Skyline\CleanSkyline.bat
IF EXIST BiblioSpec\CleanBiblioSpec.bat call BiblioSpec\CleanBiblioSpec.bat

popd
rem Exit the script
exit /b


REM subroutine for cleaning out obj and bin dirs, but avoiding any source controlled files
:CleanBinaries
rem %~1 - The directory to clean
if not exist "%~1" exit /b

rem Iterate through all files and directories in the current directory
for /d /r %~1 %%d in (obj, bin) do (
if exist "%%d" (
pushd "%%d" >nul
rem Check if the directory contains files tracked by Git (error 1 if not)
git ls-files --error-unmatch . >nul 2>&1
if errorlevel 1 (
REM contains no source controlled files, delete directory
popd >nul
rmdir /s /q "%%d"
) else (
REM remove any non-source-controlled files
git clean -f -q
popd >nul
)
)
)
exit /b
REM end of subroutine

0 comments on commit 0a4ff34

Please sign in to comment.