Is it possible to use the Kotlin Compose Compiler ...
# compose
s
Is it possible to use the Kotlin Compose Compiler only for test sources? I have a library module where the sources don't depend on Compose at all, but I'm using Compose to write some effective integration tests. Since I don't have any actual Compose dependencies in the main source set, the compiler complains that there's no compose runtime on the classpath. Rather than adding the (unused) compose runtime as a dependency I'd like to try to only apply the compose compiler to test sources first
h
I don’t think so but you can use compileOnly for the main sourceset.
đź‘€ 1
s
I ended up restructuring my tests to not use compose (I was trying to test integration with navigation and was hoping to avoid needing to create a custom test-only destination type, but ended up going down that path). Good shout on compileOnly though, I hadn't thought of that