forked from DinoChiesa/DotNetZip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean.ps1
80 lines (69 loc) · 2.26 KB
/
clean.ps1
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
# -------------------------------------------------------
# clean.ps1
#
# Cleans the various project outputs. To be used prior to zipping
# up the source tree.
#
# This script is part of DotNetZip.
# DotNetZip is Copyright 2008-2011 Dino Chiesa.
#
# DotNetZip is licensed under the MS-PL. See the accompanying
# License.txt file.
#
# Last Updated: <2011-July-30 15:54:25>
#
# -------------------------------------------------------
$msbuild = "c:\.net4.0\msbuild.exe"
$dirsToClean = @("Zip",
"Zip Reduced",
"Zip CF",
"Zip SL",
"Zip Tests",
"Zlib",
"Zlib CF",
"Zlib SL DLL",
"Zlib Tests",
"BZip2",
"BZip2 CF",
"BZip2 SL DLL",
"BZip2 Tests",
"Examples\C#\CreateZip",
"Examples\C#\ReadZip",
"Examples\C#\WinForms-QuickZip",
"Examples\C#\ZipDir",
"Examples\C#\ZipTreeView",
"Examples\VB\Quick-Unzip",
"Examples\VB\WinForms-DotNetZip",
"Examples\VB\WinForms-TreeViewZip",
"Tools\Unzip",
"Tools\BZip2",
"Tools\GZip",
"Tools\Zipit",
"Tools\ConvertZipToSfx",
"Tools\WinFormsApp"
)
get-childitem -filter *.csproj~ -recurse | remove-item
$saveloc = get-location
Write-Host ""
Write-Host "Running MSBuild /t:Clean ..."
foreach ($dir in $dirsToClean) {
Write-Host (' {0}' -f $dir)
set-location $dir
$expr = $msbuild + " /nologo /noconsolelogger /t:Clean /p:Configuration=Release"
Invoke-Expression $expr
$expr = $msbuild + " /nologo /noconsolelogger /t:Clean /p:Configuration=Debug"
Invoke-Expression $expr
set-location $saveloc
}
Write-Host ""
Write-Host "Removing bin and obj directories ..."
foreach ($dir in $dirsToClean) {
Write-Host (' {0}' -f $dir)
set-location $dir
foreach ($subdir in @("bin", "obj")) {
if (Test-Path $subdir) {
remove-item $subdir -recurse
}
}
set-location $saveloc
}