1 @if not defined _echo @echo off
2 setlocal EnableDelayedExpansion
5 if not defined NO_DASHES_ARG goto no_help
6 if /I [%NO_DASHES_ARG:-=%] == [?] goto Usage
7 if /I [%NO_DASHES_ARG:-=%] == [h] goto Usage
10 :: Check if VBCSCompiler.exe is running
11 tasklist /fi "imagename eq VBCSCompiler.exe" |find ":" > nul
12 :: Compiler is running if errorlevel == 1
14 echo Stop VBCSCompiler.exe execution.
15 for /f "tokens=2 delims=," %%F in ('tasklist /nh /fi "imagename eq VBCSCompiler.exe" /fo csv') do taskkill /f /PID %%~F
18 :: Strip all dashes off the argument and use invariant
19 :: compare to match as many versions of "all" that we can
20 :: All other argument validation happens inside Run.exe
21 if not defined NO_DASHES_ARG goto no_args
22 if /I [%NO_DASHES_ARG:-=%] == [all] (
23 echo Cleaning entire working directory ...
29 if [%1]==[] set __args=/t:CleanAllProjects
30 if [%1]==[-b] set __args=/t:CleanAllProjects
31 if [%1]==[-p] set __args=/t:CleanPackages
32 if [%1]==[-c] set __args=/t:CleanPackagesCache
33 call %~dp0dotnet.cmd msbuild /nologo /verbosity:minimal /clp:Summary /nodeReuse:false /flp:v=normal;LogFile=clean.log %__args%
38 echo Usage: clean [-b] [-p] [-c] [-all]
39 echo Repository cleaning script.
41 echo -b - Delete the binary output directory.
42 echo -p - Delete the repo-local NuGet package directory.
43 echo -c - Deletes the user-local NuGet package cache.
44 echo -all - Cleans repository and restores it to pristine state.
46 echo ^If no option is specified then "clean -b" is implied.