HugoGresse
(Hugo Gresse)
August 14, 2018, 12:15pm
1
Hi there,
Our team is working on android and ios app using java and swift.
What would be your recommendation to setup code analysis on this projects?
I’ve read that the trigger should be done on our CI (http://bitrise.io/ ) but the rest of the documentation is VERY not straight forward
xbourguignon
(Xavier Bourguignon)
August 14, 2018, 12:27pm
2
Hi Hugo,
A good start is the SonarCloud documentation and specifically the “Analysis Source Code”
And depending where your source code is hosted, you will be interested in our integrations with Github, Bitbucket Cloud and VSTS.
Hope this helps
HugoGresse
(Hugo Gresse)
August 14, 2018, 12:41pm
3
Thanks Xavier,
I’ll take a look! So there is no specific part for iOS or Android?
Another subject: I’ll sugest to improve the SonarCloud dashboard in order to make adding a new project/code analaysis very easily. It is probably just a link to the documentation in the right place.
The only specific part I can see is if you want to import coverage report: https://docs.sonarqube.org/display/PLUG/Swift+Coverage+Results+Import (it’s SonarQube oriented but still relevant for SonarCloud)
Did you try adding new project with our wizard ?
@HugoGresse Did you manage to setup SonarCloud for iOS Project ?
Is there any good documentation available for initial project setup steps ?
HugoGresse
(Hugo Gresse)
September 5, 2019, 7:11am
6
I’ve this step configured on bitrise:
if [[ -z "${BITRISE_PULL_REQUEST}" ]]; then
./sonar-scanner-3.2.0.1227-macosx/bin/sonar-scanner \
-Dsonar.projectKey=repoName \
-Dsonar.organization=orgaName \
-Dsonar.sources=./folderToAnalyze \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.sources=./folderToAnalyze \
-Dsonar.cfamily.build-wrapper-output=./bw_output/
else
./sonar-scanner-3.2.0.1227-macosx/bin/sonar-scanner \
-Dsonar.projectKey=repoName \
-Dsonar.organization=orgaName \
-Dsonar.sources=./folderToAnalyze \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.pullrequest.branch=$BITRISE_GIT_BRANCH \
-Dsonar.pullrequest.key=$BITRISE_PULL_REQUEST \
-Dsonar.pullrequest.provider=GitHub \
-Dsonar.pullrequest.github.repository=orga/repoName \
-Dsonar.sources=./folderToAnalyze \
-Dsonar.cfamily.build-wrapper-output=./bw_output/
fi