Chris Marshall
Chris Marshall

Reputation: 5332

Adding SwiftLint as a Dependency to a Podspec Project

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?

Upvotes: 1

Views: 689

Answers (2)

Chris Marshall
Chris Marshall

Reputation: 5332

Just wanted to mention that this was solved. The issue is that the boilerplate xcconfig files have header search paths encoded in them that argue with new pods (not just SwiftLint).

It's not that difficult to fix, but I decided to toss the boilerplate anyway, simply because it made a very simple little framework into a byzantine mess.

Upvotes: 0

barbarity
barbarity

Reputation: 2488

When you are in the Cocoapod project, you need to write in the Podspec that your project has a dependency on SwiftLint, not just add it :

Pod::Spec.new do |spec|
...
  spec.dependency 'SwiftLint'
end

Upvotes: 2

Related Questions