问题
Is it possible to create a pod release from a branch? It seems straight-forward enough from GitHub but pod install
keeps giving me this issue:
[!] CocoaPods could not find compatible versions for pod "XXX": In Podfile: XXXY (from
../
) was resolved to 1.0.0, which depends on XXX (~> 2.0.2)None of your spec sources contain a spec satisfying the dependency:
XXX (~> 2.0.2)
.You have either: * out-of-date source repos which you can update with
pod repo update
or withpod install --repo-update
. * mistyped the name or version. * not added the source repo that hosts the Podspec to your Podfile.
I’ve tried pod repo update
and pod install --repo-update
but it didn’t help.
Excerpt from pod spec:
Pod::Spec.new do |s|
s.name = 'XXX'
s.version = '2.0.2'
s.summary = 'XXX'
s.swift_version = '4.2'
Release on Github is as below:
This post seems similar but did not help: Cocoapods subspec issue: None of your spec sources contain a spec satisfying the dependency
回答1:
Yes.
Using the source attribute, a CocoaPods podspec can point directly to a tag that can be on any branch like:
s.version = '5.0.5'
s.source = {
:git => 'https://github.com/Foo/myRepo.git',
:tag => s.version.to_s
}
Some examples in the podspecs at https://github.com/firebase/firebase-ios-sdk
来源:https://stackoverflow.com/questions/53088586/is-it-possible-to-build-a-release-of-a-pod-from-a-branch