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

wakingrufus

01/16/2019, 3:17 AM
if i have a gradle multi project build, and one subproject is an MPP project, how can another subproject, which is a regular jvm project, depend on the jvm output from the MPP project?
as a project dependency (not deploying an artifact)
d

Dico

01/16/2019, 7:52 AM
You can make your sourceSet depend on your jvmMain sourceSet from the mpp project
That is, if
api(project(":name"))
doesn't work.
Keep in mind that you need to enforce evaluation order for this to work
So in your root project you need to do something like
project("jvmOnly").evaluationDependsOn(project("mpp"))
I just checked a project of my own, where the simple route just works.
h

h0tk3y

01/16/2019, 10:00 AM
@wakingrufus Just a project dependency should work, like
implementation(project(":mpp-library"))
– Gradle will automatically choose the appropriate target, the JVM one in your case. This is the designed way to specify dependencies of that kind, so If that doesn't work, please post more details or report an issue so we can take a look into it.
w

wakingrufus

01/16/2019, 11:56 AM
OK thanks. I will report back
That seems to work thanks
3 Views