if i have a gradle multi project build, and one su...
# multiplatform
w
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
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
@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
OK thanks. I will report back
That seems to work thanks