Join Slack
Powered by
how can i depend on the JS or native output of a M...
# 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
jw
08/24/2019, 4:39 AM
Trying to avoid doing something terrible like hardcoding a path and cross-project dependency on a task
jw
08/24/2019, 4:40 AM
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
basher
08/24/2019, 4:44 AM
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!
basher
08/24/2019, 4:48 AM
More docs on binary APIs here:
https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#building-final-native-binaries
Open in Slack
Previous
Next