Multi module: same package name leads to silently ignoring previewsΒ #361
Description
Hi π
I have two Gradle modules A and B, both with some @Preview
and both have the same package name - let's say com.example.ui
.
In my case, both are library projects with no further root, so I added a new module referencing both, A and B, and added a @ShowkaseRoot
to this module, but this is only a side note to understand how I came here.
I'm using this module to record Paparazzi screenshot tests for both modules and after capturing the screenshots I end up with either all screenshotted previews from A OR B, depending on which dependency I declared first in the module's Gradle file.
Looking at the ksp generated Showkase files I observed the following:
In module A it generated a file with content:
package com.airbnb.android.showkase
import com.airbnb.android.showkase.`annotation`.ShowkaseCodegenMetadata
import kotlin.Unit
public class ShowkaseMetadata_com_example_ui {
// not relevant content
}
and in module B it generated the absolutely equal content (which makes sense obviously).
I assume because of same package and class name Showkase fails internally somewhere at processing the file from the respective other module.
I could fix it by renaming the modules to something unique, e.g. for module A to com.example.ui.a
.
However, it would be great if Showkase at least threw some error in such a case.