I want to integrate Sonar analysis with my YAML build which is used to build iOS app with fastlane. I used AzureDevOps extensions and added wrapper. So I have this steps:
- pwsh: |
Invoke-WebRequest -Uri 'https://sonarcloud.io/static/cpp/build-wrapper-macosx-x86.zip' -OutFile 'build-wrapper.zip'
Expand-Archive -Path 'build-wrapper.zip' -DestinationPath '$(System.DefaultWorkingDirectory)'
name: 'GetSonarBuildWrapper'
displayName: 'Download Sonar build-wrapper'
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'SonarCloud'
organization: 'stormideas'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'some-project-key'
cliProjectName: 'some-project-name'
cliSources: 'Sources'
extraProperties: |
sonar.cfamily.build-wrapper-output=$(SONAR_BUILD_WRAPPER)
- pwsh: |
$(System.DefaultWorkingDirectory)/build-wrapper-macosx-x86/build-wrapper-macosx-x86 -out-dir $(SONAR_BUILD_WRAPPER) xcodebuild clean build
name: 'RunSonarBuildWrapper'
displayName: 'Run Sonar build-wrapper'
- here are sime build tasks using fastlane
- task: SonarCloudAnalyze@1
- task: SonarCloudPublish@1
inputs:
pollingTimeoutSec: '300'
I’m not sure if this is correct approach, especially that I got this error:
2020-07-02T23:16:37.6999580Z INFO: ------------------------------------------------------------------------
2020-07-02T23:16:37.7000650Z INFO: EXECUTION FAILURE
2020-07-02T23:16:37.7001790Z INFO: ------------------------------------------------------------------------
2020-07-02T23:16:37.7002410Z INFO: Total time: 48.156s
2020-07-02T23:16:37.7794480Z INFO: Final Memory: 37M/130M
2020-07-02T23:16:37.7804260Z INFO: ------------------------------------------------------------------------
2020-07-02T23:16:37.7809200Z ##[error]ERROR: Error during SonarScanner execution
2020-07-02T23:16:37.7811490Z ERROR: Error during SonarScanner execution
2020-07-02T23:16:37.7813430Z ##[error]java.lang.IllegalStateException: java.nio.file.NoSuchFileException: /Users/runner/runners/2.171.1/work/1/s/sonar-build-wrapper/build-wrapper-dump.json
2020-07-02T23:16:37.7815670Z java.lang.IllegalStateException: java.nio.file.NoSuchFileException: /Users/runner/runners/2.171.1/work/1/s/sonar-build-wrapper/build-wrapper-dump.json
2020-07-02T23:16:37.7845710Z ##[error]at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:500)
at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:317)
2020-07-02T23:16:37.7848120Z at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:500)
2020-07-02T23:16:37.7858640Z ##[error]at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
Should I use extension in this way if I want to integrate this with fastlane? How looks recommended approach for putting together fastlane + SonarClodu + Azure DevOps?