3
votes

I am using Sonar 3.2 with Ant. I have read that it should be possible to use Cobertura for unit test analysis and JaCoCo for integration test analysis. I have however not found a clear guide on how to do this with Ant. I have set the code coverage engine to be Cobertura like this:

<property name="sonar.core.codeCoveragePlugin" value="cobertura" />

Can I "reset" it to JaCoCo after Cobertura analysis has been done? Then it would be like this:

<property name="sonar.core.codeCoveragePlugin" value="cobertura" />
<property name="sonar.cobertura.reportPath" value=...
<property name="sonar.core.codeCoveragePlugin" value="jacoco" />
<property name="sonar.jacoco.itReportPath" value=...

Thanks

1

1 Answers

1
votes

I have an idea that might help you: Sonar has a clean RESTful interface that can be seen in action via Firebug for example. When you change this project setting (Configuration > General Settings > Code Coverage), peek the HTTP communication and learn how to configure this property via HTTP. It is hopefully not like rocket science. Then you can dynamically set this as you want from your ant script by for example writing a few line long Groovy script into a <script lang="groovy"> tag or as you want.