使用cocoapods更改导入的库 [英] Changing an imported library using cocoapods
问题描述
我正在使用cocoapods开展一个项目,突然间我发现自己在其中一个库中做了一些更改。如何确保这些更改永远不会被 pod更新
覆盖?有没有办法在不更新github项目的情况下在pod中引入更改?
I am working on a project using cocoapods and suddenly I see myself doing some changes in one of the libraries. How can I ensure that those changes will never be override by a pod update
? Is there any way to introduce changes in a pod without updating the github project?
UPDATE:分叉项目
我试图分叉项目并创建一个新的specfile指向新项目。我能够安装基本的东西,但是,由于某种原因,有一些安装的依赖项,但无法在pods项目中引用。目前我在我的podsfile中有这个:
I have tried to fork the project and create a new specfile to point to the new project. I was able to install the basic stuff, however, for some reason, there are some dependencies that are installed but can't be referenced inside the pods project. Currently I have this in my podsfile:
'WhirlyGlobe', :podspec => 'https://raw.github.com/tiagoalmeida/WhirlyGlobe/master/WhirlyGlobe.podspec'
图书馆的分支在 https://github.com/tiagoalmeida/WhirlyGlobe
UPDATE2:缺少标题
我发现提升标题(Pods / Headers)并且没有生成Eigen(从WhrilyGlobe使用)。
I have found that the headers (Pods/Headers) for boost and Eigen (used from the WhrilyGlobe) are not being generated.
UPDATE3:尝试对标题做点什么
我试过查看在此主题中的一些配置我已经尝试了常见问题解答中的解决方案,但我相信我的问题不同。标题实际上已丢失。
I have tried to look in some of the configurations that are in this thread and I have tried the solutions in the FAQ but I believe that my problem is different. The headers are actually missing.
UPDATE4:攻击cocoapods版本
I已经卸载了cocoapods并安装了0.20.2版本(在尝试使用我的fork之前一直工作)并保持完全相同:/。
I have uninstalled cocoapods and installed the version 0.20.2 (that was working before trying to use my fork) and it keeps all the same :/.
推荐答案
@pgb和wattson为我提供了很好的信息,但最终问题出在了各种各样的事情上。
@pgb and wattson provided me good information but ultimately the problem was in a combination of things.
我不知道为什么但似乎cocoapods 0.22处理标题的方式不同。我卸载了cocoapods并安装了版本0.20.2。
I don't know why but it seems that cocoapods 0.22 handles headers differently. I uninstalled cocoapods and installed the version 0.20.2.
要检查cocoapods的版本,我使用了 gem query
我已经用 gem卸载cocoapods
删除了cocoapods并用 gem install cocoapods安装了cocoapods --version 0.20.2
。
To check the version of cocoapods I have used gem query
and I have removed the cocoapods with gem uninstall cocoapods
and installed the cocoapods with gem install cocoapods --version 0.20.2
.
我使用了这样的podfile:
I have used my podfile like this:
'WhirlyGlobe', :podspec => 'https://raw.github.com/tiagoalmeida/WhirlyGlobe/master/WhirlyGlobe.podspec'
podspec指向我的新podspec。我这样做是因为我需要从原始podfile中删除:tag(否则它总是指向同一个地方),这样我就可以更好地控制文件。
Where podspec points to my new podspec. I made like this because I need to remove the :tag from the original podfile (otherwise it always points to the same spot) and this way I have more control over the file.
在podspec中我更改了源:
In the podspec I have changed the source:
s.source = { :git => "https://github.com/tiagoalmeida/WhirlyGlobe.git"}
指向我的前叉并删除了标签。
To point into my fork and removed the tag.
感谢@pgb和@wattson试图帮助我。上调两者都是因为它们都很有用。
Thanks @pgb and @wattson for the attempts to help me. Upvoted both because they were both usefull.
这篇关于使用cocoapods更改导入的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!