surge1
(Sergio Vargas)
January 7, 2019, 6:29pm
1
I have the following in a sonar-project.properties file for exclusions in an android project.
sonar.exclusions=**/*.png,**/*.xml,src/**/*Constants.java,src/**/*Module.java,src/**/*Component.java,src/**/*Contract.java,models/**
however, files ending in Module.java and Component.java aren’t being ignored from coverage scans. Anybody have any insight? thanks in advance!
ganncamp
(G Ann Campbell)
January 7, 2019, 7:17pm
2
Hi,
I suspect the problem is your initial “src/”. Try dropping it; it should be covered by **/
anyway.
Ann
surge1
(Sergio Vargas)
January 7, 2019, 7:23pm
3
Thanks for the response. I actually use to have it without the src/, but that didn’t work either. The src add was in an attempt to give it a more relative/ grounded path.
ganncamp
(G Ann Campbell)
January 7, 2019, 7:27pm
4
Hi,
Where/how have you specified these exclusions?
Ann
surge1
(Sergio Vargas)
January 7, 2019, 8:03pm
5
I have them in sonar-project.properties which is added as follows in a step in a circle 2.0 config
sonar-scanner -Dproject.settings=sonar-project.properties;
also have the following other properties
sonar.projectBaseDir=app/
sonar.sources=src/main/
sonar.pullrequest.base=develop
sonar.pullrequest.provider=GitHub
sonar.binaries=build/intermediates
sonar.java.binaries=build/intermediates
sonar.tests=src/test/java
sonar.java.test.binaries=build/intermediates
sonar.junit.reportsPath=build/test-results/testDebugUnitTest/
sonar.android.lint.report=build/reports/lint-results.xml
ganncamp
(G Ann Campbell)
January 7, 2019, 9:11pm
6
Hi,
Is your xml exclusion working? Also, could you try removing your exclusions from your analysis properties and specifying them in the UI instead (Project Administration > General Settings > Analysis Scope )?
Ann