diff --git a/Tasks/ANT/ant.ps1 b/Tasks/ANT/ant.ps1 index 5af0762a4bff..f8b5146eb715 100644 --- a/Tasks/ANT/ant.ps1 +++ b/Tasks/ANT/ant.ps1 @@ -108,9 +108,22 @@ if ($jdkPath) } $buildRootPath = Split-Path $antBuildFile -Parent -$reportDirectoryName = [guid]::NewGuid() +$reportDirectoryName = "ReportDirectory75C12DBC" $reportDirectory = Join-Path $buildRootPath $reportDirectoryName +try +{ + if(Test-Path $reportDirectory) + { + # delete any previous code coverage data + rm -r $reportDirectory -force | Out-Null + } +} +catch +{ + Write-Verbose "Failed to delete report directory" +} + if($isCoverageEnabled) { if ($codeCoverageTool -eq "Cobertura") @@ -128,10 +141,36 @@ $summaryFile = Join-Path $summaryFile $summaryFileName # ensuring unique code coverage report task name by using guid $CCReportTask = "CodeCoverage_" +[guid]::NewGuid() -$reportBuildFileName = [guid]::NewGuid().tostring() + ".xml" +$reportBuildFileName = "ReportBuildFile9B5907FC.xml" $reportBuildFile = Join-Path $buildRootPath $reportBuildFileName $instrumentedClassesDirectory = Join-Path $buildRootPath "InstrumentedClasses" +try +{ + if(Test-Path $reportBuildFile) + { + # delete any previous code coverage report build file + rm -r $reportBuildFile -force | Out-Null + } +} +catch +{ + Write-Verbose "Failed to delete report build file" +} + +try +{ + if(Test-Path $instrumentedClassesDirectory) + { + # delete any previous instrumented classes directory + rm -r $instrumentedClassesDirectory -force | Out-Null + } +} +catch +{ + Write-Verbose "Failed to delete instrumented classes directory" +} + if($isCoverageEnabled) { try @@ -242,23 +281,6 @@ if($isCoverageEnabled) } } -if(Test-Path $reportDirectory) -{ - # delete any previous code coverage data - rm -r $reportDirectory -force | Out-Null -} - -if(Test-Path $reportBuildFile) -{ - # delete any previous code coverage report build file - rm -r $reportBuildFile -force | Out-Null -} - -if(Test-Path $instrumentedClassesDirectory) -{ - # delete any previous instrumented classes directory - rm -r $instrumentedClassesDirectory -force | Out-Null -} Write-Verbose "Leaving script Ant.ps1" diff --git a/Tasks/ANT/task.json b/Tasks/ANT/task.json index 9dfd27753433..4208208ca897 100644 --- a/Tasks/ANT/task.json +++ b/Tasks/ANT/task.json @@ -13,7 +13,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 45 + "Patch": 46 }, "demands": [ "ant" diff --git a/Tasks/ANT/task.loc.json b/Tasks/ANT/task.loc.json index 264f9cac08f3..6efdb270ceba 100644 --- a/Tasks/ANT/task.loc.json +++ b/Tasks/ANT/task.loc.json @@ -13,7 +13,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 45 + "Patch": 46 }, "demands": [ "ant" diff --git a/Tasks/Gradle/Gradle.ps1 b/Tasks/Gradle/Gradle.ps1 index ab18b20d8224..db39de65176c 100644 --- a/Tasks/Gradle/Gradle.ps1 +++ b/Tasks/Gradle/Gradle.ps1 @@ -105,9 +105,23 @@ if ($jdkPath) $buildRootPath = $cwd $wrapperDirectory = Split-Path $wrapperScript -Parent -$reportDirectoryName = [guid]::NewGuid() +$reportDirectoryName = "ReportDirectory84B7D86C" $reportDirectory = Join-Path $buildRootPath $reportDirectoryName +try +{ + if(Test-Path $reportDirectory) + { + # delete any code coverage data + rm -r $reportDirectory -force | Out-Null + } +} +catch +{ + Write-Verbose "Failed to delete report directory" +} + + # check if project is multi module gradle build or not $subprojects = Invoke-BatchScript -Path $wrapperScript -Arguments 'properties' -WorkingFolder $buildRootPath | Select-String '^subprojects: (.*)'|ForEach-Object {$_.Matches[0].Groups[1].Value} Write-Verbose "subprojects: $subprojects" @@ -213,11 +227,4 @@ if($isCoverageEnabled) } } -if(Test-Path $reportDirectory) -{ - # delete any code coverage data - rm -r $reportDirectory -force | Out-Null -} - - Write-Verbose "Leaving script Gradle.ps1" diff --git a/Tasks/Gradle/task.json b/Tasks/Gradle/task.json index df8bd7a8e88a..8a72d5c80bcd 100644 --- a/Tasks/Gradle/task.json +++ b/Tasks/Gradle/task.json @@ -12,7 +12,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 43 + "Patch": 44 }, "demands": [ "java" diff --git a/Tasks/Gradle/task.loc.json b/Tasks/Gradle/task.loc.json index 3de71d7ce9cc..a62065c1b661 100644 --- a/Tasks/Gradle/task.loc.json +++ b/Tasks/Gradle/task.loc.json @@ -12,7 +12,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 43 + "Patch": 44 }, "demands": [ "java" diff --git a/Tasks/Maven/maven.ps1 b/Tasks/Maven/maven.ps1 index 27619a0b45c7..dcb88b80a625 100644 --- a/Tasks/Maven/maven.ps1 +++ b/Tasks/Maven/maven.ps1 @@ -109,9 +109,9 @@ import-module "Microsoft.TeamFoundation.DistributedTask.Task.TestResults" $buildRootPath = Split-Path $mavenPOMFile -Parent -$reportDirectoryName = [guid]::NewGuid() +$reportDirectoryName = "ReportDirectoryC91CDE2D" $reportDirectoryNameCobertura = "target\site\cobertura" -$reportPOMFileName = [guid]::NewGuid().tostring() + ".xml" +$reportPOMFileName = "ReportPOMFile4E52C1C4.xml" $reportPOMFile = Join-Path $buildRootPath $reportPOMFileName $reportDirectory = Join-Path $buildRootPath $reportDirectoryName $reportDirectoryCobertura = Join-Path $buildRootPath $reportDirectoryNameCobertura @@ -126,6 +126,38 @@ $CCReportTask = "jacoco:report" Write-Verbose "SummaryFileCobertura = $summaryFileCobertura" +try +{ + if(Test-Path $reportDirectory) + { + # delete any previous code coverage data + rm -r $reportDirectory -force | Out-Null + } + + if(Test-Path $reportDirectoryCobertura) + { + # delete any previous code coverage data from Cobertura + rm -r $reportDirectoryCobertura -force | Out-Null + } +} +catch +{ + Write-Verbose "Failed to delete report directory" +} + +try +{ + if(Test-Path $reportPOMFile) + { + # delete any previous code coverage data + rm $reportPOMFile -force | Out-Null + } +} +catch +{ + Write-Verbose "Failed to delete report POM file" +} + if($isCoverageEnabled) { if(Test-Path $targetDirectory) @@ -184,26 +216,4 @@ ElseIf ($codeCoverageTool -eq "Cobertura") # Run SonarQube analysis by invoking Maven with the "sonar:sonar" goal RunSonarQubeAnalysis $sqAnalysisEnabled $sqConnectedServiceName $sqDbDetailsRequired $sqDbUrl $sqDbUsername $sqDbPassword $options $mavenPOMFile $execFileJacoco -if(Test-Path $reportDirectory) -{ - # delete any previous code coverage data - rm -r $reportDirectory -force | Out-Null -} - -if(Test-Path $reportDirectoryCobertura) -{ - # delete any previous code coverage data from Cobertura - rm -r $reportDirectoryCobertura -force | Out-Null -} - -if(Test-Path $reportPOMFile) -{ - # delete any previous code coverage data - rm $reportPOMFile -force | Out-Null -} - Write-Verbose "Leaving script Maven.ps1" - - - - diff --git a/Tasks/Maven/task.json b/Tasks/Maven/task.json index 7ee1797b50bc..5b8bfaa72e1a 100644 --- a/Tasks/Maven/task.json +++ b/Tasks/Maven/task.json @@ -16,7 +16,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 53 + "Patch": 54 }, "minimumAgentVersion": "1.89.0", "instanceNameFormat": "Maven $(mavenPOMFile)", diff --git a/Tasks/Maven/task.loc.json b/Tasks/Maven/task.loc.json index 8c479145c77b..a99cf70777b0 100644 --- a/Tasks/Maven/task.loc.json +++ b/Tasks/Maven/task.loc.json @@ -16,7 +16,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 53 + "Patch": 54 }, "minimumAgentVersion": "1.89.0", "instanceNameFormat": "ms-resource:loc.instanceNameFormat",