I have Gradle multimodule project. One subproject ...
# gradle
p
I have Gradle multimodule project. One subproject is KMP and other is not Java nor Kotlin module. I need to make configuration in second such that it contains all jvm artifacts from KMP module. How can i do it?
m
You need "configurations" and sharing files between projects. See https://docs.gradle.org/current/userguide/cross_project_publications.html
Don't be fooled by the name "configuration", "configuration" is basically a list of remote files. You'll need to create a "resolvable" configuration, add a dependency to your KMP project and set the correct attributes to get only the JVM artifacts (or maybe point directly to the "jvmApiElements" outgoing variants or something like this.
It's doable. Not easy but doable.
p
Got it! Will try. Thanks!
m
To get the name of the outgoing variant, I found
./gradlew outgoingVariants
to be helpful
p
Thanks, Martin! Implement with attributes and it works!
m
Nice !!!
p
outgoingVariants task makes it more clear what attributes to substitute
💯 1