https://kotlinlang.org logo
Title
a

Andrew O Hart

03/09/2022, 10:54 AM
Has anybody managed to get Jacoco working on gradle 7? I keep getting failures when I run the jacocoTestReport task but it doesn't really tell me what? I'm trying to use it with Sonarqube for my JenkinsFile which will build it on Jenkins. Worked on our old non gradle 7 project but I'm not sure what the problem here is. Is there any examples of it with a KMM project for android/ios that anyboy knows of? Just reading here and sounds like Kover could be a good use case?
m

Matthias Geisler

03/09/2022, 11:36 AM
Maybe give Kover a shoot...however it did not convinced me when a tried it, since I already have a Plugin which works on KMP with JVM sources just fine (aside from android compose issues of Jacoco).
a

Andrew O Hart

03/09/2022, 11:37 AM
Could you share what you were using?
I wouldn't mind just using Jacoco
Our old project had it and I think it worked okay. I just need to be able to have a coverage report for sonarqube of our multiplatform code coverage
m

Matthias Geisler

03/09/2022, 11:38 AM
Sure - I am using my homebrew plugin here
a

Andrew O Hart

03/09/2022, 11:38 AM
Right now I'm not sure how i can change which test is run for kover, as it seems to use testDebugUnitTest, when what we need is allTests run
Do you know of any samples that implemented Jacoco for newer gradle versions on multiplatform?
Thanks for the link to yours, will take a look
m

Matthias Geisler

03/09/2022, 11:40 AM
You can find the plugin here
If you have any further question feel free to DM me
a

Andrew O Hart

03/09/2022, 11:46 AM
Thanks. Due to the nature of our project I'm not sure we can integrate with it, but I will have a look. If you have any information on Jacoco integration it would be really useful
m

Matthias Geisler

03/09/2022, 11:52 AM
I think you should find all necessary infos for a Jacoco and KMP integration in the plugin (therefore is the link)...you should be able "easily" to extract and convert the stuff you need into a Kotlin script (I startet out with a script...then converted it into plugin so I have less c&p work)
a

Andrew O Hart

03/09/2022, 12:27 PM
Nice that seemed to work for me! thanks!