Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Resource sharing #2248

Closed
armcha opened this issue Oct 21, 2018 · 11 comments
Closed

Resource sharing #2248

armcha opened this issue Oct 21, 2018 · 11 comments

Comments

@armcha
Copy link

armcha commented Oct 21, 2018

I think it will be great to add support to share resources between platforms, for example, strings, colours, images and so on․

@olonho
Copy link
Contributor

olonho commented Oct 21, 2018

Hmm, not sure how Kotlin/Native prevents resource sharing, or how it could help with it. Could you please elaborate?

@msink
Copy link
Contributor

msink commented Oct 21, 2018

Maybe something like #1819

Embedding resourses, like in jar on jvm

@petrukhnov
Copy link
Contributor

You could copy resources to framework by executing copy command from gradle:
cp -r "$PROJECT_DIR/src/main/resources" "$PROJECT_DIR/build/framework."

@armcha
Copy link
Author

armcha commented Oct 22, 2018

@olonho, For example, it can generate Static variables from string resources.
MyString
In code it will be something like this
Strings.my_string
or
S.my_string

@armcha
Copy link
Author

armcha commented Oct 22, 2018

@petrukhnov The problem not only to copy but also an ability to use it for other platforms

@olonho
Copy link
Contributor

olonho commented Oct 22, 2018

@nadafsak
Copy link

nadafsak commented Apr 8, 2020

This is what I do at the moment in my build.gradle to copy over resources for iOS:

            exec {
                commandLine "cp"
                args = ["-r", "$projectDir/src/commonMain/resources", "$buildDir/bin/ios/debugFramework/test_shared_library.framework"]
            }

@Alex009
Copy link

Alex009 commented Apr 19, 2020

for mobile platforms you can use https://github.com/icerockdev/moko-resources too

@nadafsak
Copy link

nadafsak commented Apr 19, 2020

for mobile platforms you can use https://github.com/icerockdev/moko-resources too

This is ok for specific assets (images, font, translation), but does not let you share generic file types like a HTML or .mp4 file.

@Alex009
Copy link

Alex009 commented Apr 19, 2020

yes, for now it is, but support of generic files will be added soon

@SvyatoslavScherbina
Copy link
Collaborator

According to migrating issue tracking to YouTrack, closing this issue in favour of https://youtrack.jetbrains.com/issue/KT-39194

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants