This may border on brain-dead-stupid, nevertheless...
# multiplatform
p
This may border on brain-dead-stupid, nevertheless. First, is it even possible to build a common module, deploy it and then use that module as a dependency for multiple independent platform modules, each deployed separately? Second, is this a really, really bad idea? It appeals to me because, assuming it can be made to work without too much pain, it offers multiple small independent modules, each likely to be easy to grok, fast to build, easy to test, and independent of platform quirks (like naming rules for test functions).
a
I'm doing this right now
but there is a caveat
p
I am trying to make this work now and the first hurdle is getting it deployed to maven local
a
you can only use common dependencies in common projects afaik
p
@addamsson do you have a github repo that shows what you have done?
l
Really? You can't depend on a common module if you're building a JVM module, for example?
m
Hmm, how does a common dependency even work? Does it somehow know where to find the actual artifact for each platform?
Like, you can't really compile a common artifact before you know its platform target, right?
a
@LeoColman you can build a jvm artifact from a common module and you can depend on that
wait a sec
p
Oh, I got it, I think. One deploys the common pieces (metadata?) to be used as a dependency for the common modules that each platform uses. Something along these lines.
a
so in this project I build all 3
common, jvm, js
and i have another project which depends on this
here I depend on common modules
p
@addamsson nice. I’ll check out now.
a
in the common module
and in the jvm module I depend on the jvm artifacts: https://github.com/Hexworks/amethyst/blob/master/amethyst.core/build.gradle#L50