Skip to content
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

Fix aggregate target dependencies with transitivelyLinkDependencies #383

Merged
merged 5 commits into from
Aug 22, 2018

Conversation

brentleyjones
Copy link
Collaborator

Fixes #381 to work with the transitivelyLinkDependencies flag.

@yonaskolb
Copy link
Owner

Could you add a changelog entry

@@ -981,6 +981,9 @@ public class PBXProjGenerator {
queue.append(dependencyTarget)
}
}
} else {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good if the code showed what was happening as well as the comment. For completion sake could we add a Project.getAggregateTarget(_ name: String) -> AggregateTarget function and use it here

} else if project.getAggregateTarget(dependency.reference) != nil {

@yonaskolb
Copy link
Owner

Good catch 👍

@brentleyjones
Copy link
Collaborator Author

Done and done 😄.

private var targetsMap: [String: Target]
private var aggregateTargetsMap: [String: AggregateTarget]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One missing map creation in the aggregateTargets setter

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Fixed.

@yonaskolb
Copy link
Owner

Actually, looks like getAllCarthageDependencies will need updating too...

@brentleyjones
Copy link
Collaborator Author

I hadn't considered that. I'll fix that quick. Related, in my Static Framework work, I'll be consolidating those and doing the caching work we talked about.

@yonaskolb
Copy link
Owner

Awesome. Yeah those 2 could be combined and optimised by only running over the graph once 👍

@brentleyjones
Copy link
Collaborator Author

Updated for Carthage dependencies as well.

queue.append(target)
} else if let aggregateTarget = projectTarget as? AggregateTarget {
for dependencyName in aggregateTarget.targets {
if let projectTarget = project.getProjectTarget(dependencyName) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This highlights a question. Should getAllDependenciesPlusTransitiveNeedingEmbedding be checking aggregateTarget.targets as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went down that route at first. It wouldn't since it's the same as shouldEmbedDependencies in my mind. An aggregate target will be merging it's targets, they shouldn't propagate up, at least automatically. If that's the desire, it can still be done manually.

In the new algorithm this will be expressible explicitly.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@yonaskolb yonaskolb merged commit 6a0c8c8 into master Aug 22, 2018
@yonaskolb yonaskolb deleted the transitive-aggragate-targets branch August 22, 2018 14:47
@yonaskolb
Copy link
Owner

Released 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants