https://kotlinlang.org logo
m

Matej Drobnič

06/23/2019, 4:35 PM
Is it possible to have normal module and multiplatform module in the same gradle project?
e

egorand

06/23/2019, 4:59 PM
what’s the use case for that?
you can declare custom configurations and set different attributes on them, then the same multiplatform dependency will be resolved into different artifacts
m

Matej Drobnič

06/23/2019, 5:04 PM
well I do not want to publish the library on maven yet, it is much more convenient to have them linked by gradle until it's finished
e

egorand

06/23/2019, 5:07 PM
oh, wait, you’re saying you want to have a project with the same name to be both a standalone module and a platform variant of a multiplatform module inside the same project?
m

Matej Drobnič

06/23/2019, 6:02 PM
no
I mean gradle project that has both normal jvm and multiplatform submodules
e

egorand

06/23/2019, 6:04 PM
sure, that works
you can’t depend on a multi-module project though, every module is in fact a project, producing its own artifact
m

Matej Drobnič

06/23/2019, 6:27 PM
ah, so normal JVM project cannot depend on multi module project (its jvm artifact)?
e

egorand

06/23/2019, 6:35 PM
Multi module project produces multiple artifacts
if by “multi module” you mean “multiplatform” - then yes, a JVM project can depend on the JVM variant of a multiplatform project
the easiest way to make it work is by applying
org.jetbrains.kotlin.jvm
plugin to your JVM project