-
Notifications
You must be signed in to change notification settings - Fork 99
Swift AST Support (alpha)
The idea for building dependency tree using Swifts AST (Abstract syntax tree) is relatively simple Swifts AST contains all information that can be needed in order to build dependency tree All dependencies can be tracked relatively easy by traversing the AST and gathering information attached to the nodes of AST
In the current version of the visualizer, output of the --ast-dump
is used
For this, we would need to change swift compiler to our proxy and run build phase once
Setup instructions can be found here
The current version of the dependency visualizer parses the output of the --ast-dump
and builds own AST tree, using Ruby library. The parsing itself is not 100% perfect due to some instability :) and fragility of the output.
In general, it cannot be used as the source of truth, so some parts can be missed, while some unexpected dependencies can be found
- Potentially the most detailed dependency tree can be built
- Different types of the dependencies can be tracked easily
- Different objects can be tracked easily
- Fragile, plugin/driver will be more reliable
- No optimizations are performed over AST tree
- Slow tree traversing for big projects
./generate-objc-dependencies-to-json.rb --ast-file file.ast > origin.js