Duplicate dependency validation introduces issues
https://github.com/yonaskolb/XcodeGen/pull/1234 introduces new issues. It seems it checks dependencies added through different app targets as duplicate, but I'm not sure.
@rgnns, do you have an example?
I'll try recreating it with something I could share. But the gist of it is that we have a dynamic framework which uses certain dependencies (say Combine.framework) and then it will report it as duplicate. This will happen even if the only place I add such dependency is in such framework.
Hmm, this was my pull request, so if the issue is really in place I can take fixing it on myself. But for now I don't see the root of the problem. In my company we also have several targets in project and some of them always have the same dependencies, but we didn't meet with the problem you described. Maybe you have standard libs declared as dependencies, somewhere in shared templates?
Yeah, I've been trying to reproduce this but I can't isolate the issue. Maybe we're doing setting wrong on our project, but is strange because the duplicates are being reported everywhere even though the reported dependencies are not duplicate.
Found the issue. It's not the validation but the way Xcodegen is resolving the project targets. It merges targets if the path hasn't already been resolved, which uses a relative path as it is, hence if the path is included from different locations, the targets will be resolved multiple times and resulting in multiple dependencies been appended. I have a PR to address this by using the relativePath used when resolvingPaths instead of the declared filePath. https://github.com/yonaskolb/XcodeGen/pull/1241
I confirm we see this as well. We do have points where we need to redeclare targets in some of our test targets due to the state of our Bazel integration, and this new dependency check breaks our ability to properly link/generate our project. So definitely having a way to make this optional/check the pathing would be nice
We have been using my fix since the moment I created that PR and we've had no issues. I wish we could merge it so we didn't have to maintain a fork.