【问题标题】:How to remove podspecs completely from Xcode and repo?如何从 Xcode 和 repo 中完全删除 podspecs?
【发布时间】:2018-10-19 16:14:58
【问题描述】:

我有一个拥有庞大代码库的项目,它有 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,它会产生很多错误和架构问题。

【问题讨论】:

  • 它帮助我删除了我的 pod 项目,但它也删除了所有其他有用的 pod。我只想从 pod 中删除我的项目文件、资产(central 文件夹),并希望将其添加到 bundle 中以用作 bundle,而不是用作 pod。

标签: ios xcode cocoapods podspec podfile


【解决方案1】:

我找到了!!

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

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

【讨论】:

    猜你喜欢
    • 2012-05-22
    • 1970-01-01
    • 2011-07-12
    • 2023-01-25
    • 1970-01-01
    • 1970-01-01
    • 2017-03-07
    • 2014-01-09
    • 2023-04-01
    相关资源
    最近更新 更多