New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add implicit type to Dependency #165
Conversation
Nice! Have you tested it on your own project? |
Yeah, tested in a workspace with 5 |
Awesome. I wonder if this should be a new type of dependency or just an option on |
That could work. Just need to be explicit in the docs that it only applies to |
Yeah, there are already some options that are only applied to certain types, or have different defaults. That reminds me, can you update ProjectSpec.md? Maybe an |
This is interesting, and perhaps adding transitive dependency logic could be useful. Let's say I've got a project:
We'd want to propagate all of the dependencies to the Application, so that they are all linked and or embedded. The The current way I'm achieving this is adding all transitive deps directly to top level targets, like
Is this something that Based on #163 it seems like this may be related? |
@jerrymarino good point. At the moment only carthage dependencies are automatically copied into app targets even if they aren't defined in that target, but are in a dependent target. (this isn't the case for macOS targets anymore by the way as it hasn't been added back yet after the changes in #76 removed that as a side effect) This would be possible for other dependency types as well, but I just thought there would be too many edge cases and special build settings and build scripts that people might have, to do this reliably for anything else. |
@yonaskolb agreed, I like the idea of not imposing those semantics on everyone without a way to turn it off. The above mentioned logic should generalize for many use cases: Transitively adding frameworks and static libraries ( this is similar to how cocoa pods works ) to top level targets. I think it's a sensible default, but @sbarow I think manually adding transitive deps to applications and extension targets may solve this without a new dependency type in XcodeGen 🤷♂️ ? |
@jerrymarino the goal is to not have to do anything manually 😜 Regarding transitive dependencies, its an interesting one and something I have thought about. At Uber we use buck and do transitive dependency resolution manually (with the help of auditing that lets us know if we are missing a dependency in the BUCK file) I believe its a more sane approach to let the user know they are missing a dependency for a target, the other thing to consider is cyclic dependencies. I'll take a look at both in another diff? |
As a first pass, this seems like all that is needed to add an implicit framework dependency. Are there any other edge cases we need to worry about?
I'll add some tests when I get a 👍
Fixes: #163