compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

[Compose resources]: Allow custom naming of "Res" class generated

Open rsktash opened this issue 1 year ago • 6 comments

Using compose resources in multi module project we have to give alias when importing Res classes from multiple modules

import package.name.modulea.Res
import package.name.moduleb.Res as ResB
import package.name.modulec.Res as ResC

It would be good enhancement to allow custom names for this class

import package.name.modulea.ResA
import package.name.moduleb.ResB
import package.name.modulec.ResC

rsktash avatar May 06 '24 09:05 rsktash

Have you tried type aliases? In the modulea: typealias ResA = Res

terrakok avatar May 06 '24 20:05 terrakok

@terrakok couldn't access inner property ResA.string

telegram-cloud-photo-size-2-5316804612482783469-y

telegram-cloud-photo-size-2-5316804612482783468-x

rsktash avatar May 07 '24 00:05 rsktash

The only solution was to create an extra object and expose properties

telegram-cloud-photo-size-2-5316804612482783472-y

rsktash avatar May 07 '24 00:05 rsktash

https://youtrack.jetbrains.com/issue/KT-34281 😞

terrakok avatar May 07 '24 10:05 terrakok

I'm curious, multi-module resources are not supported yet, are they? @rustamsmax

psuzn avatar May 18 '24 11:05 psuzn

@psuzn supports from kotlin 2.0

rsktash avatar May 18 '24 11:05 rsktash

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

okushnikov avatar Aug 26 '24 13:08 okushnikov