I am doing a multiplatform library that supports a...
# multiplatform
j
I am doing a multiplatform library that supports android. Is the JVM target enough in build.gradle or should I add an Android target?
k
It’s enough if you don’t need anything android specific in your jvm code
j
Thanks. What about iOS and windows, macos etc. How do I support them. I am using a windows machine.
c
I would start with a JVM-only target, and only add Android if there’s something specific you need from it
j
This is my build.gradle.kts btw. Can this support all platforms? https://github.com/jeffnyauke/Mpesa-Kotlin-Multiplatform/blob/master/build.gradle.kts
@Casey Brooks @kpgalligan
a
Hello, @Jeff! OSX and iOS targets won’t be available for a Windows host machine.
j
Thanks @Artyom Degtyarev [JB] . To support all the targets including iOS, MacOS, Linux, windows, Android how should I structure the build.gradle.kts.
a
I’m not sure that the script structure can make a lot of help here. The problem is in the host compatibility. The multiplatform plugin is smart enough to skip all targets that are unavailable at the moment. A list of targets and its cross-platform ability can be found here and here. About adding the android target. You can either left things as they are(as you already have a
jvm
target included), or try to play with android support as told in the documentation, or look at this wonderful template.