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

ptsiogas

03/21/2021, 1:38 PM
Hi there, Is it possible to use “native.cocoapods” library in order to automatically publish the common code in github as a cocoa pod library? The auto generated podspec sets the source as:
Copy code
spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" }
This works fine locally but I want to change it to something like:
Copy code
spec.source = { :git => 'git@my_path.git', :tag => s.version.to_s}
P.S Ideally I would like to use 2 repositories (Android + KMM, iOS) and feed the iOS app with a KMM cocoa pod.
@Kris Wong you are my last hope :)
k

Kris Wong

03/22/2021, 1:36 PM
the cocoapods plugin does not provide this functionality. typically your build server or another plugin might provide this.
this is technically not specific to KMM. any strategy for publishing a cocoapod would apply.
however, keep in mind that the cocoapods plugin uses a vendored framework, which means your framework would need to be hosted somewhere (like Artifactory).
p

ptsiogas

03/22/2021, 1:39 PM
But this procedure is quite standard in iOS native code and you can share your private pods though github. So this seems like a native.cocoapods specific issue to me.
k

Kris Wong

03/22/2021, 1:40 PM
and what technique do you use to share your other podspec files with git?
p

ptsiogas

03/22/2021, 1:42 PM
We set the source in podspec like this:
Copy code
spec.source = { :git => 'git@my_path.git', :tag => s.version.to_s}
In native.cocoapods the podspec is autogenerated, so we cannot change it manually, at least that’s my understanding, correct me if I am wrong.
k

Kris Wong

03/22/2021, 2:01 PM
it is autogenerated, but that doesn't mean it can't be changed before it's pushed to a git repo
p

ptsiogas

03/22/2021, 2:45 PM
Do you have in mind any working example, I would really appreciate it.
k

Kris Wong

03/22/2021, 3:05 PM
I do not
👍 1
2 Views