https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
j

jw

08/24/2019, 4:30 AM
how can i depend on the JS or native output of a MPP module and embed it as a resource of a plain-'ol java module?
b

basher

08/24/2019, 4:38 AM
In gradle or manually?
j

jw

08/24/2019, 4:38 AM
Gradle
Trying to avoid doing something terrible like hardcoding a path and cross-project dependency on a task
I have a 'js' module where I add the output bundle to a named configuration which I can then depend on from another project: https://github.com/JakeWharton/SdkSearch/blob/master/frontend/chrome-extension/content/build.gradle#L23-L31
b

basher

08/24/2019, 4:42 AM
Not sure about JS. This is a good example for native for how to both depend on and get the output of the link task (nearly always final output unless you do something custom): https://github.com/jetbrains/kotlin/blob/master/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/KotlinGradleMobileSharedMultiplatformModuleBuilder.kt#L188
For the embedding part, I'd say just make a Copy task that depends on the link task
j

jw

08/24/2019, 4:44 AM
yeah. hopefully JS follows a similar structure. i'm sure i can discover it based on this. thanks!
b

basher

08/24/2019, 4:44 AM
No prob!