Skip to content

Commit a34d298

Browse files
committed
Fixing Java tasks
1 parent 1d3e000 commit a34d298

File tree

9 files changed

+53
-57
lines changed

9 files changed

+53
-57
lines changed

Tasks/ANT/ant.ps1

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,15 @@ if ($jdkPath)
108108
}
109109

110110
$buildRootPath = Split-Path $antBuildFile -Parent
111-
$reportDirectoryName = [guid]::NewGuid()
111+
$reportDirectoryName = "ReportDirectory_75C12DBC-FB59-450A-8E4F-772EA8BFCFA6"
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+
}
119+
114120
if($isCoverageEnabled)
115121
{
116122
if ($codeCoverageTool -eq "Cobertura")
@@ -128,10 +134,22 @@ $summaryFile = Join-Path $summaryFile $summaryFileName
128134
# ensuring unique code coverage report task name by using guid
129135
$CCReportTask = "CodeCoverage_" +[guid]::NewGuid()
130136

131-
$reportBuildFileName = [guid]::NewGuid().tostring() + ".xml"
137+
$reportBuildFileName = "ReportBuildFile_9B5907FC-EC56-4662-B8EA-EC23FCB97C43.xml"
132138
$reportBuildFile = Join-Path $buildRootPath $reportBuildFileName
133139
$instrumentedClassesDirectory = Join-Path $buildRootPath "InstrumentedClasses"
134140

141+
if(Test-Path $reportBuildFile)
142+
{
143+
# delete any previous code coverage report build file
144+
rm -r $reportBuildFile -force | Out-Null
145+
}
146+
147+
if(Test-Path $instrumentedClassesDirectory)
148+
{
149+
# delete any previous instrumented classes directory
150+
rm -r $instrumentedClassesDirectory -force | Out-Null
151+
}
152+
135153
if($isCoverageEnabled)
136154
{
137155
try
@@ -242,23 +260,6 @@ if($isCoverageEnabled)
242260
}
243261
}
244262

245-
if(Test-Path $reportDirectory)
246-
{
247-
# delete any previous code coverage data
248-
rm -r $reportDirectory -force | Out-Null
249-
}
250-
251-
if(Test-Path $reportBuildFile)
252-
{
253-
# delete any previous code coverage report build file
254-
rm -r $reportBuildFile -force | Out-Null
255-
}
256-
257-
if(Test-Path $instrumentedClassesDirectory)
258-
{
259-
# delete any previous instrumented classes directory
260-
rm -r $instrumentedClassesDirectory -force | Out-Null
261-
}
262263
Write-Verbose "Leaving script Ant.ps1"
263264

264265

Tasks/ANT/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 45
16+
"Patch": 46
1717
},
1818
"demands": [
1919
"ant"

Tasks/ANT/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 45
16+
"Patch": 46
1717
},
1818
"demands": [
1919
"ant"

Tasks/Gradle/Gradle.ps1

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,15 @@ if ($jdkPath)
105105

106106
$buildRootPath = $cwd
107107
$wrapperDirectory = Split-Path $wrapperScript -Parent
108-
$reportDirectoryName = [guid]::NewGuid()
108+
$reportDirectoryName = "ReportDirectory_84B7D86C-F08D-4B65-8D37-742D8B02D27B"
109109
$reportDirectory = Join-Path $buildRootPath $reportDirectoryName
110110

111+
if(Test-Path $reportDirectory)
112+
{
113+
# delete any code coverage data
114+
rm -r $reportDirectory -force | Out-Null
115+
}
116+
111117
# check if project is multi module gradle build or not
112118
$subprojects = Invoke-BatchScript -Path $wrapperScript -Arguments 'properties' -WorkingFolder $buildRootPath | Select-String '^subprojects: (.*)'|ForEach-Object {$_.Matches[0].Groups[1].Value}
113119
Write-Verbose "subprojects: $subprojects"
@@ -213,11 +219,4 @@ if($isCoverageEnabled)
213219
}
214220
}
215221

216-
if(Test-Path $reportDirectory)
217-
{
218-
# delete any code coverage data
219-
rm -r $reportDirectory -force | Out-Null
220-
}
221-
222-
223222
Write-Verbose "Leaving script Gradle.ps1"

Tasks/Gradle/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"version": {
1313
"Major": 1,
1414
"Minor": 0,
15-
"Patch": 43
15+
"Patch": 44
1616
},
1717
"demands": [
1818
"java"

Tasks/Gradle/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"version": {
1313
"Major": 1,
1414
"Minor": 0,
15-
"Patch": 43
15+
"Patch": 44
1616
},
1717
"demands": [
1818
"java"

Tasks/Maven/maven.ps1

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ import-module "Microsoft.TeamFoundation.DistributedTask.Task.TestResults"
109109

110110

111111
$buildRootPath = Split-Path $mavenPOMFile -Parent
112-
$reportDirectoryName = [guid]::NewGuid()
112+
$reportDirectoryName = "ReportDirectory_C91CDE2D-CC66-4541-9C27-E3EF6CB3DB16"
113113
$reportDirectoryNameCobertura = "target\site\cobertura"
114-
$reportPOMFileName = [guid]::NewGuid().tostring() + ".xml"
114+
$reportPOMFileName = "ReportPOMFile_4E52C1C4-8C32-4580-A54D-41D5E9ED1F74.xml"
115115
$reportPOMFile = Join-Path $buildRootPath $reportPOMFileName
116116
$reportDirectory = Join-Path $buildRootPath $reportDirectoryName
117117
$reportDirectoryCobertura = Join-Path $buildRootPath $reportDirectoryNameCobertura
@@ -126,6 +126,24 @@ $CCReportTask = "jacoco:report"
126126

127127
Write-Verbose "SummaryFileCobertura = $summaryFileCobertura"
128128

129+
if(Test-Path $reportDirectory)
130+
{
131+
# delete any previous code coverage data
132+
rm -r $reportDirectory -force | Out-Null
133+
}
134+
135+
if(Test-Path $reportDirectoryCobertura)
136+
{
137+
# delete any previous code coverage data from Cobertura
138+
rm -r $reportDirectoryCobertura -force | Out-Null
139+
}
140+
141+
if(Test-Path $reportPOMFile)
142+
{
143+
# delete any previous code coverage data
144+
rm $reportPOMFile -force | Out-Null
145+
}
146+
129147
if($isCoverageEnabled)
130148
{
131149
if(Test-Path $targetDirectory)
@@ -184,26 +202,4 @@ ElseIf ($codeCoverageTool -eq "Cobertura")
184202
# Run SonarQube analysis by invoking Maven with the "sonar:sonar" goal
185203
RunSonarQubeAnalysis $sqAnalysisEnabled $sqConnectedServiceName $sqDbDetailsRequired $sqDbUrl $sqDbUsername $sqDbPassword $options $mavenPOMFile $execFileJacoco
186204

187-
if(Test-Path $reportDirectory)
188-
{
189-
# delete any previous code coverage data
190-
rm -r $reportDirectory -force | Out-Null
191-
}
192-
193-
if(Test-Path $reportDirectoryCobertura)
194-
{
195-
# delete any previous code coverage data from Cobertura
196-
rm -r $reportDirectoryCobertura -force | Out-Null
197-
}
198-
199-
if(Test-Path $reportPOMFile)
200-
{
201-
# delete any previous code coverage data
202-
rm $reportPOMFile -force | Out-Null
203-
}
204-
205205
Write-Verbose "Leaving script Maven.ps1"
206-
207-
208-
209-

Tasks/Maven/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"version": {
1717
"Major": 1,
1818
"Minor": 0,
19-
"Patch": 53
19+
"Patch": 54
2020
},
2121
"minimumAgentVersion": "1.89.0",
2222
"instanceNameFormat": "Maven $(mavenPOMFile)",

Tasks/Maven/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"version": {
1717
"Major": 1,
1818
"Minor": 0,
19-
"Patch": 53
19+
"Patch": 54
2020
},
2121
"minimumAgentVersion": "1.89.0",
2222
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",

0 commit comments

Comments
 (0)