CocoaPods/CocoaPods — Issue #119: Multiple targets, dependency conflicts/duplication
Author: lukeredpath
Created: 2012-02-10 17:03:39+00:00
State: open

In this example, I have an application, "APP A" which has a dependency on a library "LIB A". "LIB A" has a dependency on "LIB B", ergo when "APP A" is linked to libPods, it contains "LIB A" and "LIB B".

However, "APP A" also has a dependency on a static library that is being developed alongside it, in a separate target within the same project. Let's call this "LOCAL LIB C". Now, "LOCAL LIB C" has it's own dependencies in the Podfile, in an exclusive target, let's call it libPods-mylib. "LOCAL LIB C" has a dependency on the same "LIB B" as above.

Now, when libPods-mylib is linked to "LOCAL LIB C", and "LOCAL LIB C" is linked to "APP A", I have a duplicate object problem with the objects in "LIB B" appearing in "APP A" twice, once via libPods and again via ("LOCAL LIB C" => "libPods-lib").

Does that all make sense?

Possible workarounds:

1) Extend the 'dependency' API that lets us exclude dependencies of dependencies, e.g.:

```ruby
dependency "SomeLibraryThatUsesJSONKit", :exclude_dependencies => ["JSONKit"]
```

2) Don't compile my own library "LOCAL LIB C" as a separate static library, but instead treat it as a local CocoaPod, and define the specification for it inline. (can we specify local sources?).

Thoughts?