Graph validation at compile-time
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.
Should potentially work with https://github.com/jpsim/SourceKitten/pull/615/files
SourceKitten still seems to not print out information about annotations. Postponing this one to 1.5.0 (or later).
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!
Could potentially work with 0.30.0: Cats Don't Wear Masks, still need to test that thing out.
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.
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 😊