-
Notifications
You must be signed in to change notification settings - Fork 1
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal visibility not respected: Internal Previews returned even though executes in a different module #20
Comments
I’m afraid that is unfortunately not possible. For now, the best you can do is mark such internal previews with your own annotation e.g AndroidComposablePreviewScanner()
…
.excludeIfAnnotatedWithAnyOf(
ExcludeForScreenshot::class.java,
)
…
.getPreviews() |
I tried using Kotlin Reflect but couldn't find a solution. I was able to determine if a function is internal, but the challenging part is checking if it's in the same module. |
Well, I think we can work around this by specifying scanPackages() in each module as well. |
Another elegant solution would be to make the previews private (I’m actually still thinking what is a valid use case for an internal preview 🧐), and use |
I haven't tried it yet, but the current behavior of includePrivatePreviews() in feature/a will likely include private previews from core/designsystem as well. 👀 |
I think I am misunderstanding your use case 🧐 I’ll keep this open in case somebody wants to fix it, but I believe I’ll not prioritize this for now. |
We are experiencing an issue where we encounter classes that we do not intend to see.
Consider a scenario with modules such as
feature/a
,feature/b
, andcore/designsystem
. Thedesignsystem
module contains some previews.When we aim to conduct Preview screenshot testing within a module for rapid updates, the previews from
designsystem
are captured multiple times.Therefore, my proposal is to support the internal modifier of Kotlin for Preview functions.
If a Preview function is marked as internal, it should not be accessible from other modules.
However, currently, we are uncertain how to determine if a function belongs to the same module.
The text was updated successfully, but these errors were encountered: