@@ -108,14 +108,21 @@ if ($jdkPath)
108108}
109109
110110$buildRootPath = Split-Path $antBuildFile - Parent
111- $reportDirectoryName = " ReportDirectory_75C12DBC-FB59-450A-8E4F-772EA8BFCFA6 "
111+ $reportDirectoryName = " ReportDirectory75C12DBC "
112112$reportDirectory = Join-Path $buildRootPath $reportDirectoryName
113113
114- if (Test-Path $reportDirectory )
115- {
116- # delete any previous code coverage data
117- rm - r $reportDirectory - force | Out-Null
118- }
114+ try
115+ {
116+ if (Test-Path $reportDirectory )
117+ {
118+ # delete any previous code coverage data
119+ rm - r $reportDirectory - force | Out-Null
120+ }
121+ }
122+ catch
123+ {
124+ Write-Verbose " Failed to delete report directory"
125+ }
119126
120127if ($isCoverageEnabled )
121128{
@@ -134,20 +141,34 @@ $summaryFile = Join-Path $summaryFile $summaryFileName
134141# ensuring unique code coverage report task name by using guid
135142$CCReportTask = " CodeCoverage_" + [guid ]::NewGuid()
136143
137- $reportBuildFileName = " ReportBuildFile_9B5907FC-EC56-4662-B8EA-EC23FCB97C43 .xml"
144+ $reportBuildFileName = " ReportBuildFile9B5907FC .xml"
138145$reportBuildFile = Join-Path $buildRootPath $reportBuildFileName
139146$instrumentedClassesDirectory = Join-Path $buildRootPath " InstrumentedClasses"
140147
141- if (Test-Path $reportBuildFile )
148+ try
149+ {
150+ if (Test-Path $reportBuildFile )
151+ {
152+ # delete any previous code coverage report build file
153+ rm - r $reportBuildFile - force | Out-Null
154+ }
155+ }
156+ catch
142157{
143- # delete any previous code coverage report build file
144- rm - r $reportBuildFile - force | Out-Null
158+ Write-Verbose " Failed to delete report build file"
145159}
146160
147- if (Test-Path $instrumentedClassesDirectory )
161+ try
162+ {
163+ if (Test-Path $instrumentedClassesDirectory )
164+ {
165+ # delete any previous instrumented classes directory
166+ rm - r $instrumentedClassesDirectory - force | Out-Null
167+ }
168+ }
169+ catch
148170{
149- # delete any previous instrumented classes directory
150- rm - r $instrumentedClassesDirectory - force | Out-Null
171+ Write-Verbose " Failed to delete instrumented classes directory"
151172}
152173
153174if ($isCoverageEnabled )
0 commit comments