Hello All I have one project which is currently ta...
# gradle
n
Hello All I have one project which is currently targeted as Android app. This project have one kotlin library module. Purpose of this module is to maintain only kotlin specific code not anything Android related. In Android app’s build.gradle.kts dependecy of that module added and also includes in settings.gradle.kts ====== Now when I write the one gradle.kts script for Jacobo to get code base from all submodules(means the kotlin library) In SubProjects it returns 0 as a subproject. https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#getSubprojects-- Can anyone help me in how to get all attached library modules in gradle script written in buildSrc ? • App’s build.gradle.kts : https://gist.github.com/adneerav/a864c9fc25c7659e35fcbd5e9ae2a0d8 • Settings.gradle.kts :: https://gist.github.com/adneerav/fa0378889b611b45c670bedb598aed97 • Kotlin library’s build.gradle.kts : https://gist.github.com/adneerav/d7cbdeabbd13d28d84a4e78eb6f5f556 • Gradle Script from buildSrc : https://gist.github.com/adneerav/b352d65a01a7a7545fd6a1b49df8d542
v
Are you trying to create an aggregated JaCoCo report?
n
You read my mind 😄
v
Then just use the
jacoco-report-aggregation
plugin 🙂
n
Do you have any suggested blogs or any sample to take reference. I want to add this for main Android app and libraries are in Kotlin without any android dependecies
v
I have just the docs I linked you to at hand. But actually if you say "Android app" it might not be compatible according to those docs. So you might need to do it manually like the plugin does but adapted to Android, no idea. I'm not doing Android development and also don't know why it is not compatible with the android application plugin.
e
Kover should be able to generate a coverage report and includes aggregation task, https://github.com/Kotlin/kotlinx-kover
Plus it has better support for inlined code 🙂
e
I don't think it works for Android projects yet either
e
Huh.. I understood the following as if android support would be no problem (Feature bullet #4)
Support for
Kotlin Android
without the need to divide it into build types and flavours.
e
oh! that seems to be added since the last time I checked… over a year ago. neat, worth a shot
n
Thanks for help and sharing details. I think still I need to wait to switch from jacoco to Kover as rightnow its not supported to generate specific build flavors and type wise report. https://github.com/Kotlin/kotlinx-kover/issues/18 But thanks again for sharing 🤝