@@ -14,53 +14,42 @@ jobs:
1414 echo "BuildId = $(buildId)"
1515 displayName: 'Print buildId'
1616
17- - task : UseDotNet@2
18- displayName : Use .NET 8.0
19- inputs :
20- packageType : ' sdk'
21- version : ' 8.0.x'
17+ - script : |
18+ dotnet tool install --global dotnet-sonarscanner
19+ displayName: 'Install SonarScanner tool'
2220
2321 - task : PowerShell@2
24- displayName : " Use JDK11 by default"
22+ displayName : " Use JDK17 by default"
2523 inputs :
2624 targetType : ' inline'
2725 script : |
28- $jdkPath = $env:JAVA_HOME_11_X64
26+ $jdkPath = $env:JAVA_HOME_17_X64
2927 Write-Host "##vso[task.setvariable variable=JAVA_HOME]$jdkPath"
3028
3129 - script : |
3230 dotnet dev-certs https --trust || true
3331 displayName: 'dotnet dev-certs https'
3432
35- - task : SonarCloudPrepare@1
36- displayName : ' Prepare analysis on SonarCloud'
33+ - script : |
34+ dotnet sonarscanner begin /k:"WireMock-Net_WireMock.Net" /o:"wiremock-net" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.token="$(SONAR_TOKEN)" /d:sonar.dotnet.excludeTestProjects=true /d:sonar.cs.opencover.reportsPaths=**/coverage.net8.0.opencover.xml /d:sonar.verbose=true
35+ displayName: 'Begin analysis on SonarCloud'
3736 condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
38- inputs :
39- SonarCloud : SonarCloud
40- organization : wiremock-net
41- projectKey : ' WireMock-Net_WireMock.Net'
42- projectName : ' WireMock.Net'
43- extraProperties : |
44- sonar.cs.opencover.reportsPaths=**/coverage.net8.0.opencover.xml
4537
4638 - task : DotNetCoreCLI@2
4739 displayName : ' Build Unit tests'
4840 inputs :
4941 command : ' build'
5042 projects : ' ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj'
51- arguments : ' --configuration Debug --framework net8.0'
43+ arguments : ' --configuration Debug --framework net8.0 --no-incremental '
5244
5345 - task : CmdLine@2
5446 inputs :
5547 script : ' dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --no-build --configuration Debug --framework net8.0'
5648 displayName : ' Execute Unit Tests with Coverage'
57-
58- - task : SonarCloudAnalyze@1
59- displayName : ' SonarCloud: Run Code Analysis'
60- condition : and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
6149
62- - task : SonarCloudPublish@1
63- displayName : ' SonarCloud: Publish Quality Gate Result'
50+ - script : |
51+ dotnet sonarscanner end /d:sonar.token="$(SONAR_TOKEN)"
52+ displayName: 'End analysis on SonarCloud'
6453 condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
6554
6655 - task : whitesource.ws-bolt.bolt.wss.WhiteSource Bolt@19
0 commit comments