1

I'm fairly new to Cocoapods, and I'm hoping this is a question easily answered by 'RTFM', but the 'M' provided by Cocoapods doesn't seem to answer my question.

I'm applying SwiftLint to my projects.

I can easily add it to my projects that include other pods (simply add "pod 'SwiftLint', '~> 0.24'"), but I'm having difficulty adding it to my Cocoapod project.

Like I said, I'm really just a couple of weeks into Cocoapods, and know there's a ways down this rabbit-hole. This project is also a conversion from a previous structure, so it wasn't a 1-to-1 conversion to the Cocoapods structure.

The problem is that I need to be able to add SwiftLint to the BMLTiOSLib project in the same way that I do in the projects that incorporate BMLTiOSLib. This is something that I'd run at build time for BMLTiOSLib.

When I write up a podfile for SwiftLint, I get a number of collisions, and, quite frankly, I don't know enough about the inner workings of Cocoapods to properly diagnose them.

Is there a fairly basic guide to including things like SwiftLint into a Cocoapod project?

4

2 回答 2

2

当您在 Cocoapod 项目中时,您需要在 Podspec 中写入您的项目对 SwiftLint 的依赖,而不仅仅是添加它:

Pod::Spec.new do |spec|
...
  spec.dependency 'SwiftLint'
end
于 2017-12-10T21:13:23.823 回答
0

只是想提一下,这已经解决了。问题是样板 xcconfig 文件中编码的标头搜索路径与新的 pod(不仅仅是 SwiftLint)争论。

修复起来并不难,但我还是决定扔掉样板,只是因为它把一个非常简单的小框架变成了拜占庭式的混乱。

于 2017-12-12T14:59:18.697 回答