JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.02k stars 1.1k forks source link

Make the generated resource accessors public #4812

Closed sergeys-opera closed 2 weeks ago

sergeys-opera commented 2 weeks ago

When working in a multi-module project sometimes it makes sense to share resources between modules. I don't think it's possible now with Compose Resources as the generated Res object and the resources accessors have internal modifier. It would be good to be able to instruct the compose plugin to generate public resource accessors.

Compose version: 1.6.10-rc02

terrakok commented 2 weeks ago

https://www.jetbrains.com/help/kotlin-multiplatform-dev/1.6.10/compose-images-resources.html#setup

compose.resources {
    publicResClass = true
}
sergeys-opera commented 2 weeks ago

Great, thanks!