XcodeGen icon indicating copy to clipboard operation
XcodeGen copied to clipboard

Embedding project reference targets in multiple targets

Open mqzkim opened this issue 3 years ago • 5 comments

To solve this, https://github.com/yonaskolb/XcodeGen/issues/933 Add dependencySet to avoid duplicate project reference targets

  • Added test code for MultipleXcodeProject with MultipleTargetDependencies

~Also)~ ~- Project framework would be included frameworkFiles.~

mqzkim avatar Jul 19 '21 18:07 mqzkim

if there are mutliple targets with the same depdency on same target from project reference, this fix will set incorrect dependencies

PaulTaykalo avatar Sep 03 '21 07:09 PaulTaykalo

if there are mutliple targets with the same depdency on same target from project reference, this fix will set incorrect dependencies

@PaulTaykalo Would you provide any example that I can reproduce your issue?

mqzkim avatar Feb 24 '22 04:02 mqzkim

I tried to see what an Xcode generated setup would look like. It seems this PR is definitely on the correct path. Unique PBXContainerItemProxy are needed per target.

Here Parent and ParentTests are linking Child1 and Child2.

@PaulTaykalo Did you have more info on the issues with this PR?

Screenshot 2023-03-15 at 5 55 01 PM

Test.zip

simonpierreroy avatar Mar 15 '23 21:03 simonpierreroy

Tried this branch again - have the same result. this update will break dependencies generation with complex depencies.

This is an oversimplified example of our project. If arrows are dependencies, and B is target from project reference, then for project C, dependency on B target is not present in the XML. (Or it's invalid. Hard to tell).

graph TD
A.pbxproj --> B[Target from B.pbxproj]
C.pbxproj --> B[Target from B.pbxproj] 
linkStyle 1 stroke: red, stroke-width: 2px;

I can't provide more detailed explanation on this, but this PR breaks that part. Not sure if I'll be able to drill down to the root cause of the problem

PaulTaykalo avatar Mar 22 '23 20:03 PaulTaykalo

Like these deps are not generated:

Incorrect (this PR)

image

Correct

image

PaulTaykalo avatar Mar 22 '23 20:03 PaulTaykalo