Alexander Stark
04/09/2018, 10:45 AMolonho
04/09/2018, 11:44 AM-l mine.klib
or libraries
DSL verb in Gradle, in Kotlin/JVM it is way harder, you need to produce dynamic library with -p dynamic
and manually convert object arguments. For Kotlin/JS it is never tried, but likely using N-API (https://nodejs.org/api/addons.html) it could be done in the way similar to Kotlin/JVM.Alexander Stark
04/09/2018, 1:04 PMolonho
04/09/2018, 1:21 PMjava.net.HttpURLConnection
on Java, NSURLSession
on iOS, libcurl on Linux)Alexander Stark
04/09/2018, 1:24 PMSam
04/09/2018, 2:07 PMolonho
04/09/2018, 2:08 PMgildor
04/09/2018, 2:21 PMI want to use this lib in my pure kotlin moduleCommon module cannot work without platform, on compile time common module just compiled to target platform code, so only platform independent code can work everywhere (the code that you can write in common module). libcure is obviously native only dependency. You just cannot implement http client completely module independent, you need some platfrom specific part that work at least with sockets (but usually you want to use some more high level abstraction). Of course you can compile libcurl and use it on iOS and Android as native dependency, but you need also JNI for JVM and ObjC glue code for Swift to use native lib, so I don’t think this is good solution, actually almost nobody uses such approach for pure Android/iOS apps without big native part But I agree, that everyone needs multiplatform Kotlin HTTP client library for multiplatfrom client and would be nice to have one, hope ktor http-client will be released as separate http library for multiplatform kotlin.