Can someone please point me to an example of a min...
# announcements
k
Can someone please point me to an example of a minimal gradle build file that will allow building a shared library for Android and iOS targets, but without including a full blown sub project for each. There won't be any platform specific code. It will literally be the same code compiled for both targets. I've been banging my head against this for days using IDEA templates and official samples as starting points but I'm getting nowhere.
r
You should probably ask in #C3PQML5NU
g
kotlin-multiplatform plugin out of the box works like that, there is one module that configured for all target platforms, each of them may have own source set, but platform source sets are optional, you can use only common
Maybe samples may help, there is no Android + iOS lib sample, but shows general approach, there are some iOS + Android samples, but don't remember exactly where you can find them, try start from MPP plugin samples and docs
k
@Ruckus Good call. Posted late at night. Sorry.
Thanks @gildor. I'll check that link out. I've already read the official docs and samples thoroughly and all the Android examples seem to include a full project.
g
and all the Android examples seem to include a full project.
But it only for testing, just remove android-app specific configs See for example this example: https://github.com/h0tk3y/k-new-mpp-samples/tree/master/android-lib-and-app-with-mpp/lib
k
The problem is that I don't know what to remove and what to leave such that, for instance, declaring an android() target will work.
r
Hey @kieran this is a little more advanced than what you need but it’s the base of multiple MPP projects I created with only common code, just remove the parts using an iOS Framework https://gist.github.com/Ribesg/95a172ceb2177d74cf5b15993d40092e
k
Thanks @ribesg. Looks like it'll be a good starting point.
g
The problem is that I don’t know what to remove
Nothing from this module https://github.com/h0tk3y/k-new-mpp-samples/tree/master/android-lib-and-app-with-mpp/lib
maybe you could show your existing attempt and describe problem that you have