Skip to content

Commit 99c98e5

Browse files
authored
Implement make target "purge" (#1503)
1 parent c7365b7 commit 99c98e5

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

make.ps1

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,36 @@ function Test([String] $target, [String] $configuration, [String[]] $frameworks,
214214
RunTestTasks $tasks
215215
}
216216

217+
function Purge() {
218+
Main "Clean" "Release"
219+
Main "Clean" "Debug"
220+
221+
Write-Verbose "Deleting ""obj"" directories..."
222+
Get-ChildItem -Name "obj" -Directory -Path "$_BASEDIR" -Recurse | Remove-Item -Force -Recurse
223+
224+
Write-Verbose "Deleting ""bin"" directories..."
225+
foreach ($dir in @("", (Join-Path "IronPythonAnalyzer" "IronPythonAnalyzer"))) {
226+
if (Test-Path (Join-Path $_BASEDIR $dir "bin" -OutVariable targetPath)) {
227+
Remove-Item -Path $targetPath -Force -Recurse
228+
}
229+
}
230+
231+
Write-Verbose "Deleting "".binlog"" files..."
232+
Remove-Item -Path (Join-Path $_BASEDIR "*.binlog")
233+
234+
Write-Verbose "Deleting packaging artifacts..."
235+
foreach ($dir in @("Release", "Debug")) {
236+
if (Test-Path (Join-Path $_BASEDIR "Package" $dir -OutVariable targetPath)) {
237+
Remove-Item -Path $targetPath -Force -Recurse
238+
}
239+
}
240+
241+
Write-Verbose "Deleting test run settings..."
242+
Remove-Item -Path (Join-Path $_BASEDIR "Src" "IronPythonTest" "runsettings.*.xml")
243+
244+
Write-Information "Done. Consider restoring dependencies." -InformationAction Continue
245+
}
246+
217247
switch -wildcard ($target) {
218248
# debug targets
219249
"restore-debug" { Main "RestoreReferences" "Debug" }
@@ -243,6 +273,7 @@ switch -wildcard ($target) {
243273
& "${env:SystemRoot}\Microsoft.NET\Framework\v4.0.30319\ngen.exe" install $imagePath
244274
}
245275
}
276+
"purge" { Purge }
246277

247278
default { Write-Error "No target '$target'" ; Exit -1 }
248279
}

0 commit comments

Comments
 (0)