Thread
#multiplatform
    Marcello Galhardo

    Marcello Galhardo

    10 months ago
    Hey folks, how are you all handling resources in a multi-platform world? For example, on Android we would normally have a R class with all resources but that would be a problem to share them with Desktop and iOS apps... Any resource (links, good tutorials, GitHub with code...) Is welcomed! Thank you in advance! 🤔
    wbertan

    wbertan

    10 months ago
    Here we use https://github.com/icerockdev/moko-resources so far works fine, we share Strings and PNGs from Shared code to Android and iOS - KMM project, not sure if would work with Desktop too 🤔
    ankushg

    ankushg

    10 months ago
    it does seem to have some support for jvm and macos which is nice, but no js unforutnately I'm looking forward to the feature announced at the premier event where downstream consumers can define actuals for unsupported platforms. I think it was something like external expects?
    Mark Schisler

    Mark Schisler

    10 months ago
    We used Square’s KotlinPoet to generate our own colors and locales from flat files.
    It was pretty simple to do and less complicated than moko-resources
    There’s not a whole lot of value in sharing images as they are different files (PDF vs SVG), so that’s pretty irrelevant.
    wbertan

    wbertan

    10 months ago
    Agreed, we don’t share when it is PDF/SVG 😞 Currently approach is to have an
    enum
    “representing” the icon and the view resolves it to the native icon. BUT we also use some PNGs, which moko-resource is fine to share. Also we share directly as
    String
    , our shared classes resolve (via some extensions) from the
    StringDesc
    to
    String
    .