This is for an Android app - I created an annotation which causes Jacoco to exclude some methods from the generated coverage XML. When I diff the XMLs it does exclude the method the the report.
I can’t just mark the files as excluded in the sonar properties because this is for @Preview code in Jetpack Compose, which needs to be in the same file as the actual component definitions (which should not be excluded).
When I push the code through CI and it gets sent to sonar, the code is still marked as uncovered, in the new code list.
The most I could find was that Sonar “uses the jacoco xml”, but does that mean that any methods not included in the XML are counted as uncovered? That seems to be at odds with the jacoco assumption that removing it means it is not counted.