https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
e

eygraber

04/24/2022, 8:27 AM
I just published uri-kmp a uri library for all kmp targets, ported from AOSP's
Uri
implementation. Check it out, I'd love to hear your feedback 😄
💙 1
b

Big Chungus

04/24/2022, 1:33 PM
I wonder why you didn't typealias to android URI if you ported it from there? Would help ease the interop with other android libs
e

eygraber

04/24/2022, 2:18 PM
Meaning have an expect class with an actual that is a typealias on Android, and an actual that uses the common implementation on other platforms?
b

Big Chungus

04/24/2022, 2:18 PM
Exactly
This is a recommended approach when porting existing APIs from one platform to mpp
Good example of that is #compose-desktop
e

eygraber

04/24/2022, 2:38 PM
Good to know. A few reasons why I might not do that here: 1. I slightly changed the API and implementation 2. It's a platform class on Android, so there could be different behavior depending on the version of Android being used 3. It's a relatively small and simple class I'll have to give all that some more thought.
d

David Nedrow

04/25/2022, 8:49 PM
I assume
implementation("com.eygraber:uri-kmp:0.0.3")
goes in commonMain?
e

eygraber

04/25/2022, 8:50 PM
That's correct. Is there an issue with that?
d

David Nedrow

04/25/2022, 8:50 PM
Nope, just wasn’t clear from the README.md
e

eygraber

04/25/2022, 8:51 PM
Good point, I copied that from one of my other projects. I'll update the README
👍 1
b

Big Chungus

04/25/2022, 11:04 PM
That artefact can go into jsMain jvmMain, etc... too. Gradle metadata will resolve it just fine.
3 Views