-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathClean.cmd
167 lines (138 loc) · 3.97 KB
/
Clean.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
@echo off
rem ********************************************************************************
rem
rem Remove virtually all temporary build artefacts as Visual Studio leaves plenty of
rem detritus lying around. We leave the .suo and .user files around unless --all is
rem specified as its often desirable to clean the workspace but leave some
rem temporary settings, like breakpoints, in place.
rem
rem This script sits between "devenv /clean" and "git clean -fdx".
rem
rem ********************************************************************************
setlocal enabledelayedexpansion
:handle_help_request
if /i "%~1" == "-?" call :usage & exit /b 0
if /i "%~1" == "--help" call :usage & exit /b 0
:do_clean
echo Removing VC++ intermediate files...
del /s /f *.pch 2> nul
del /s /f *.ipch 2> nul
del /s /f *.sbr 2> nul
del /s /f *.obj 2> nul
del /s /f *.res 2> nul
del /s /f *.tlh 2> nul
del /s /f *.tli 2> nul
del /s /f *.tlb 2> nul
del /s /f *_p.c 2> nul
del /s /f *_h.h 2> nul
del /s /f *_i.c 2> nul
del /s /f dlldata.c 2> nul
del /s /f BuildLog.htm 2> nul
del /s /f *.manifest 2> nul
del /s /f mt.dep 2> nul
del /s /f *.tlog 2> nul
del /s /f *ResolveAssemblyReference.cache 2> nul
del /s /f *.lastbuildstate 2> nul
del /s /f *.unsuccessfulbuild 2> nul
del /s /f *_manifest.rc 2> nul
del /s /f *.recipe 2> nul
del /s /f *.vcxproj.FileListAbsolute.txt 2> nul
echo Removing VC++ target files...
del /s /f *.pdb 2> nul
del /s /f *.idb 2> nul
del /s /f *.ilk 2> nul
del /s /f *.exe 2> nul
del /s /f *.dll 2> nul
del /s /f *.lib 2> nul
del /s /f *.plg 2> nul
del /s /f *.map 2> nul
del /s /f *.exp 2> nul
echo Removing VC++ workspace files...
del /s /f *.ncb 2> nul
del /s /f *.sdf 2> nul
del /s /f *.opt 2> nul
del /s /f *.aps 2> nul
del /s /f *.bsc 2> nul
del /s /f *.vcxproj.user 2> nul
del /s /f *.vcxproj.filters 2> nul
del /s /f *.VC.db 2> nul
if /i "%~1" == "--all" (
del /ah /s /f *.suo 2> nul
del /s /f *.vcproj.*.user 2> nul
)
echo Removing VC++ profiling/instrumentation files...
del /s /f *.pbi 2> nul
del /s /f *.pbo 2> nul
del /s /f *.pbt 2> nul
del /s /f *._xe 2> nul
del /s /f *.pcc 2> nul
del /s /f *.stt 2> nul
del /s /f *.dpcov 2> nul
echo Removing WiX files...
del /s /f *.wixobj 2> nul
del /s /f *.wixpdb 2> nul
del /s /f *.msi 2> nul
echo Removing Chocolatey files...
for /d /r %%i in (Chocolatey) do if exist "%%i" (
rmdir /s /q "%%i\bin" 2> nul
del /f "%%i\*.nupkg" 2> nul
)
echo Removing Code::Blocks target files...
del /s /f *.gch 2> nul
del /s /f *.o 2> nul
del /s /f *.a 2> nul
echo Removing Code::Blocks workspace files...
if /i "%~1" == "--all" (
del /s /f *.depend 2> nul
del /s /f *.layout 2> nul
)
echo Removing Doxygen folders...
for /d /r %%i in (dox) do (
if exist "%%i" (
del "%%i\*.css" 2> nul
del "%%i\*.html" 2> nul
del "%%i\*.js" 2> nul
del "%%i\*.png" 2> nul
rmdir /q "%%i" 2> nul
)
)
echo Removing log files...
del /s /f *.log 2> nul
del /s /f TraceLog.txt 2> nul
del /s /f *.sup 2> nul
echo Removing other files...
del /s /f *.mht 2> nul
for /d /r %%i in (debug) do if exist "%%i" del /s /f "%%i\*.ini" 2> nul
for /d /r %%i in (release) do if exist "%%i" del /s /f "%%i\*.ini" 2> nul
rmdir /s /q VSMacros71 2> nul
for /d /r %%i in (*.tlog) do @if exist "%%i" rmdir "%%i" 2> nul
del /s /f unsuccessfulbuild 2> nul
del /s /f RSP*.rsp 2> nul
del /s /f FileList.txt 2> nul
del /s /f *.zip 2> nul
echo Removing Debug and Release directories...
for /d /r %%i in (ipch) do if exist "%%i" rmdir /s /q "%%i" 2> nul
for /d /r %%i in (.vs) do if exist "%%i" rmdir /s /q "%%i" 2> nul
for /d /r %%i in (Debug) do (
if exist "%%i" (
rmdir "%%i\Win32" 2> nul
rmdir "%%i\x64" 2> nul
rmdir "%%i" 2> nul
)
)
for /d /r %%i in (Release) do (
if exist "%%i" (
rmdir "%%i\Win32" 2> nul
rmdir "%%i\x64" 2> nul
rmdir "%%i" 2> nul
)
)
:success
exit /b 0
rem ************************************************************
rem Functions
rem ************************************************************
:usage
echo.
echo Usage: %~n0 [--all]
goto :eof