@@ -14,53 +14,42 @@ jobs:
14
14
echo "BuildId = $(buildId)"
15
15
displayName: 'Print buildId'
16
16
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'
22
20
23
21
- task : PowerShell@2
24
- displayName : " Use JDK11 by default"
22
+ displayName : " Use JDK17 by default"
25
23
inputs :
26
24
targetType : ' inline'
27
25
script : |
28
- $jdkPath = $env:JAVA_HOME_11_X64
26
+ $jdkPath = $env:JAVA_HOME_17_X64
29
27
Write-Host "##vso[task.setvariable variable=JAVA_HOME]$jdkPath"
30
28
31
29
- script : |
32
30
dotnet dev-certs https --trust || true
33
31
displayName: 'dotnet dev-certs https'
34
32
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.branch.name=$(Build.SourceBranchName) /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'
37
36
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
45
37
46
38
- task : DotNetCoreCLI@2
47
39
displayName : ' Build Unit tests'
48
40
inputs :
49
41
command : ' build'
50
42
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 '
52
44
53
45
- task : CmdLine@2
54
46
inputs :
55
47
script : ' dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --no-build --configuration Debug --framework net8.0'
56
48
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
61
49
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'
64
53
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
65
54
66
55
- task : whitesource.ws-bolt.bolt.wss.WhiteSource Bolt@19
0 commit comments