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

diego-gomez-olvera

04/25/2022, 10:37 AM
hello! How do you share the iOS CocoaPods Pods? I use Artifactory for Android/Java (with maven-publish), so it would be convenient to upload them there as well. I am using cocoapods plugin saw about CocoaPods repositories and cocoapods-art but I cannot find if the setup would require to publish then separate or together for a multiplatform library.
it turns out that it's better to publish to two repositories with two different commands. Sharing code towards Kotlin build is supported but publishing to other build systems is challenging and can lead to problems (e.g. different versions might have runtimes incompatibilities, including GC) so it's only safe to do in a constrained environment. Thanks @Konstantin Tskhovrebov for your help!
👍 1
k

kpgalligan

04/25/2022, 2:46 PM
We’re doing a mix with something we’ve been working on for a bit. Essentially publishing a compiled build for dev, so iOS devs can update and run
pod install
to get the latest, but avoid building locally. That supports also being able to debug Kotlin locally in Xcode. Actually publishing for Cocoapods, we’ve been pushing the XCFramework zip to S3 and using
pod repo push
with private repos. Probably what
podPublish
does, but need to look at it.
👍 2
d

diego-gomez-olvera

04/25/2022, 2:48 PM
I am not familiar with S3, but isn't it more suitable to use Artifactory over a generic storage?
if it works fine, I can check it as an option as well
k

kpgalligan

04/25/2022, 2:50 PM
Depends what you need I guess. So far it’s been S3, but it would be kind of client driven, so if we had a client that wanted Artifactory (or anything else) over S3, we’d push it there.
1
d

diego-gomez-olvera

04/25/2022, 2:51 PM
ok, I will check it out too. Thanks for sharing!
d

David Nedrow

04/25/2022, 9:02 PM
@diego-gomez-olvera You should be able to push to artifactory without a problem. Here are the jfrog docs… https://www.jfrog.com/confluence/display/JFROG/CocoaPods+Repositories
l

Lucas Schiavini

04/26/2022, 12:43 AM
I went @kpgalligan’s route as well, having a compiled kotlin (.klib + resources) code so that the ios app can fetch by running
pod install
. It seemed that was the best I could do without any cocoapod publishing structure
But looking at what @David Nedrow said about jfrogs I'm definitelly interested as well.
k

kpgalligan

04/26/2022, 12:49 AM
I’ll have to read it, but I don’t understand why on the artifactory. Private podspec repos seem to still need git, and the binary zip needs a url. I would imagine github access controls would be sufficient. Again, though, need to read it.
I guess restated, I’ve only seen internal publishing use private github and a bucket to post the file. Our sample size is not huge, though, so Artifactory for cocoapods may be more common in some orgs.
We are currently doing something “weird” which is building a binary XCFramework zip if the Kotlin code changed, on CI, and pushing that to S3. On each PR merge. Not publishing it like a new version. It gets downloaded and run (basically) like a locally built framework, and you can still debug it, but the iOS dev doesn’t need to install/configure/run Kotlin tools unless they’re editing Kotlin. Some teams wanted to introduce Kotlin without adding a whole bunch of steps the iOS team might object to. Trying it out, anyway. We’re also publishing versioned pods to private repos, but again, not sure what the artifactory is doing in the middle, except hosting the zip?
d

diego-gomez-olvera

04/26/2022, 8:01 AM
Initially I will try Artifactory because it is what is used for general artefacts like Android/JVM, so I can keep a single configuration/authentication for CI to upload them
35 Views