Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi module: same package name leads to silently ignoring previews #361

Open
Syex opened this issue Oct 27, 2023 · 0 comments
Open

Multi module: same package name leads to silently ignoring previews #361

Syex opened this issue Oct 27, 2023 · 0 comments

Comments

@Syex
Copy link

Syex commented Oct 27, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant