Skip to content

Commit 3d40718

Browse files
author
Nitin Gurram
committed
Force error silently continue
1 parent eac3882 commit 3d40718

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

Tasks/ANT/ant.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ if ($isCoverageEnabled)
139139
Remove-Item -Recurse -Force $instrumentedClassesDirectory -ErrorAction SilentlyContinue
140140

141141
# Create temp copy - requried in case of TFVC
142-
Copy-Item $antBuildFile "$antBuildFile.tmp" -Force -ErrorAction Continue
143-
Set-ItemProperty $antBuildFile -Name Attributes -Value Normal
142+
Copy-Item $antBuildFile "$antBuildFile.tmp" -Force -ErrorAction SilentlyContinue
143+
Set-ItemProperty $antBuildFile -Name Attributes -Value Normal -Force -ErrorAction SilentlyContinue
144144

145145
try
146146
{
@@ -240,8 +240,8 @@ if($isCoverageEnabled)
240240
}
241241

242242
# Reset temp copy and file permissions are reset by default
243-
Copy-Item "$antBuildFile.tmp" $antBuildFile -Force -ErrorAction Continue
244-
Remove-Item "$antBuildFile.tmp" -Force -ErrorAction Continue
243+
Copy-Item "$antBuildFile.tmp" $antBuildFile -Force -ErrorAction SilentlyContinue
244+
Remove-Item "$antBuildFile.tmp" -Force -ErrorAction SilentlyContinue
245245
}
246246

247247
Write-Verbose "Leaving script Ant.ps1"

Tasks/Gradle/Gradle.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ if ($isCoverageEnabled)
150150

151151
Remove-Item -Recurse -Force $reportDirectory -ErrorAction SilentlyContinue
152152
# Create temp copy - requried in case of TFVC
153-
Copy-Item $buildFile "$buildFile.tmp" -Force -ErrorAction Continue
154-
Set-ItemProperty $buildFile -Name Attributes -Value Normal
153+
Copy-Item $buildFile "$buildFile.tmp" -Force -ErrorAction SilentlyContinue
154+
Set-ItemProperty $buildFile -Name Attributes -Value Normal -Force -ErrorAction SilentlyContinue
155155

156156
# Enable code coverage in build file
157157
Enable-CodeCoverage -BuildTool 'Gradle' -BuildFile $buildFile -CodeCoverageTool $codeCoverageTool -ClassFilter $classFilter -ClassFilesDirectories $classFilesDirectories -SummaryFile $summaryFileName -ReportDirectory $reportDirectoryName -IsMultiModule (!$singlemodule) -ErrorAction Stop
@@ -219,8 +219,8 @@ if ($isCoverageEnabled)
219219
}
220220

221221
# Reset temp copy and file permissions are reset by default
222-
Copy-Item "$buildFile.tmp" $buildFile -Force -ErrorAction Continue
223-
Remove-Item "$buildFile.tmp" -Force -ErrorAction Continue
222+
Copy-Item "$buildFile.tmp" $buildFile -Force -ErrorAction SilentlyContinue
223+
Remove-Item "$buildFile.tmp" -Force -ErrorAction SilentlyContinue
224224
}
225225

226226
Write-Verbose "Leaving script Gradle.ps1"

Tasks/Maven/maven.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ Remove-Item -Recurse -Force $targetDirectory -ErrorAction SilentlyContinue
132132

133133
if ($isCoverageEnabled)
134134
{
135-
Copy-Item $mavenPOMFile "$mavenPOMFile.tmp" -Force -ErrorAction Continue
136-
Set-ItemProperty $mavenPOMFile -Name Attributes -Value Normal
135+
Copy-Item $mavenPOMFile "$mavenPOMFile.tmp" -Force -ErrorAction SilentlyContinue
136+
Set-ItemProperty $mavenPOMFile -Name Attributes -Value Normal -Force -ErrorAction SilentlyContinue
137137
}
138138

139139
# Enable Code Coverage
@@ -188,8 +188,8 @@ RunSonarQubeAnalysis $sqAnalysisEnabled $sqConnectedServiceName $sqDbDetailsRequ
188188
# Reset temp copy and file permissions are reset by default
189189
if ($isCoverageEnabled)
190190
{
191-
Copy-Item "$mavenPOMFile.tmp" $mavenPOMFile -Force -ErrorAction Continue
192-
Remove-Item "$mavenPOMFile.tmp" -Force -ErrorAction Continue
191+
Copy-Item "$mavenPOMFile.tmp" $mavenPOMFile -Force -ErrorAction SilentlyContinue
192+
Remove-Item "$mavenPOMFile.tmp" -Force -ErrorAction SilentlyContinue
193193
}
194194

195195
Write-Verbose "Leaving script Maven.ps1"

0 commit comments

Comments
 (0)