Is it possible to build a release of a Pod from a Branch?

戏子无情 提交于 2019-12-24 18:21:18

问题


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 with pod 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!