如何从 Xcode 和 repo 中完全删除 podspecs?

How to remove podspecs completely from Xcode and repo?

我有一个代码库庞大的项目,它有 4 个不同的目标应用程序。

现在有很多视图、模型和控制器对于所有 4 个目标应用程序都是通用的。因此,那些常用文件 类 和图像资产被放置在 central 文件夹中,该文件夹充当 pod 库。我必须 运行 pod install 来获取所有 central 代码依赖项。

这是我的 Podfile 文件的样子。

#Pod sources
source 'https://github.com/CocoaPods/Specs.git'
source 'https://bitbucket.org/ttttt/xxxxxxxx.git'
source 'https://xx-xxxxxx/xxxxx/xxx/xxxx.git'

# Use the same pod library for all these targets
def myPods
    pod 'ABC', :path => '.' #'ABC' is name of pods in .podspecs file, which I want to remove
end

target 'target1' do
    myPods
end

target 'target2' do
    myPods
end

target 'target3' do
    myPods
end

target 'target4' do
    myPods
end

这里ABC是项目名。并在本地路径导入 ABC.podspecs

现在,我想删除 ABC.podspecs 个文件并在本地制作所有代码(而不是作为 pod 库)。

有人可以建议我怎么做吗? 如果我直接删除它并 运行 pod install,它会产生很多错误和架构问题。

找到了!!

我所做的是,将所有依赖目标移动到 PodFile 中。然后从项目中删除 ProjectName.podspecs 文件。然后删除Pods、pod lock文件和工作空间,再次运行pod install。 此过程从 pods 项目中删除了所有开发 pods 和依赖项。

之后,对于所有 central 文件、类、资产,我已将所有 4 个目标设置为 target membership 来自 Xcode 中的右检查器。而且效果很好。