Kotlin / kotlinx-kover

Apache License 2.0
1.35k stars 53 forks source link

Configuring kotlinx-kover in a multimodule Android project where only the app module has defined flavors #468

Closed dawidhyzy closed 1 year ago

dawidhyzy commented 1 year ago

I’m having trouble configuring kotlinx-kover in a multimodule Android project where only the app module has defined flavors.

./gradlew koverHtmlReport fails with

Could not determine the dependencies of task ':app:koverHtmlReport'.
> Could not resolve all task dependencies for configuration ':app:koverExternalArtifacts'.
   > Could not resolve project :core:designsystem:common.
     Required by:
         project :app
      > The consumer was configured to find attribute 'kotlinx.kover.variant.name' with value ''. However we cannot choose between the following variants of project :core:designsystem:common:
          - debugRuntimeElements
          - releaseRuntimeElements

how should I configure it?

shanshin commented 1 year ago

Hi, could you clarify, did you apply the Kover plugin in the :core:designsystem:common subproject?

dawidhyzy commented 1 year ago

No, I didn't. Should I do it?

shanshin commented 1 year ago

Yes, according docs:

it is necessary to apply Kover plugin in each subproject for which coverage needs to be measured.

dawidhyzy commented 1 year ago

Sorry, for that. It works now.