sergio-sastre / ComposablePreviewScanner

A library to help auto-generate screenshot tests from Composable Previews with any screenshot testing library: JVM-based (i.e. Paparazzi, Roborazzi) as well as Instrumentation-based (i.e. Shot, Dropshots, Android-Testify, etc.)
MIT License
121 stars 1 forks source link

Enable Desktop support by adding ComposablePreviewScanner dependency instead of copy-pasting code from :core and :jvm #3

Open sergio-sastre opened 1 month ago

sergio-sastre commented 1 month ago

Due to this issue #1 in 0.1.0 caused due to missing Compose Runtime, I've made all modules, :core, :android and :jvm "android libs" as first step, so it can be used in Android projects.

However, this also means that the :jvm module cannot be used in Desktop-Compose projects. The right solution is to make :core and :jvm modules support multiplatform.

From the dependency perspective, it should be possible, but I'm lacking experience in releasing Kotlin multiplatform libraries, and need to research how to overcome the compose runtime problem in the :core module.

This is likely not going to happen before 8th July.

If anybody has experience with it, feel free to open a PR :) I'd appreciate some help :)

WORKAROUND For now, the workaround is to copy the code of the :core and :jvm folders in your compose-desktop project and add the missing dependencies

    testImplementation 'org.jetbrains.kotlin:kotlin-reflect:1.9.22'
    testImplementation 'io.github.classgraph:classgraph:4.8.173'

and that should solve it.