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

Graph validation at compile-time #22

Open
benjohnde opened this issue Sep 19, 2019 · 6 comments
Open

Graph validation at compile-time #22

benjohnde opened this issue Sep 19, 2019 · 6 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Milestone

Comments

@benjohnde
Copy link
Member

benjohnde commented Sep 19, 2019

Could be implemented by traversing the Sources and collect each @Inject for creating the dependency-graph. If no circular dependencies are found, continue with collecting information about the dependency container creations and derive the final module catalogue. From here on it is rather easy to validate.

@benjohnde benjohnde added this to the 1.3.0 milestone Sep 19, 2019
@benjohnde benjohnde added enhancement New feature or request question Further information is requested labels Sep 19, 2019
@benjohnde
Copy link
Member Author

benjohnde commented Sep 19, 2019

@benjohnde benjohnde self-assigned this Sep 19, 2019
@benjohnde benjohnde modified the milestones: 1.3.0, 1.4.0 Oct 17, 2019
@benjohnde
Copy link
Member Author

SourceKitten still seems to not print out information about annotations. Postponing this one to 1.5.0 (or later).

@benjohnde benjohnde modified the milestones: 1.4.0, 1.5.0 Oct 18, 2019
@benjohnde benjohnde added the help wanted Extra attention is needed label Oct 23, 2019
@benjohnde benjohnde modified the milestones: 1.5.0, 1.6.0 Oct 29, 2019
@benjohnde
Copy link
Member Author

I am going to tackle that one again, version 0.26.0: Cinco de Gato did not print out information about annotations. Let's see!

@benjohnde
Copy link
Member Author

Could potentially work with 0.30.0: Cats Don't Wear Masks, still need to test that thing out.

@benjohnde
Copy link
Member Author

benjohnde commented Aug 26, 2020

In a nutshell @brototyp: my idea was as described above to check for circular dependencies and to check if all desired injections can be resolved successfully. I did not want to do any type of preprocessing magic in terms of what Java or Kotlin offers with the annotation preprocessor magic as it would not feel idiomatic for Swift / Xcode. So I thought about using something like SourceKitten to traverse the Sources, collect the use of DIKit with the AST (which is provided by SourceKitten) and then infer the actual graph for some validation.

@brototyp
Copy link
Contributor

Hm. I see. And then the users of DIKit would add a build phase that basically just calls a script? I'll try to understand this on a high level, maybe I can help out 😊

@benjohnde benjohnde modified the milestones: 1.6.0, 2.0.0 Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants