This project is a small utility to create a relationship graph for protocols, classes and structs in a Swift codebase.
- NodeJS
>= 6.5.0
- Graphviz's
dot
- Ensure your NodeJS version is
6.5.0
or later. - Install Graphviz's
dot
command line utility.- On macOS you can install it with
brew
:
brew install graphviz
- On macOS you can install it with
- Install package dependencies:
npm install
.
Until this is published in NPM registry...
git clone git@github.com:Sumolari/swift-relationship-graph.git
cd swift-relationship-graph
npm install -g .
swift-relationship-graph <pathToJSON> [<operation>, <type...>, <pathToOutputFile>]
Where filename
is the path to a SourceKitten's documentation JSON.
- Available
operation
s:dotGraphCode
dotGraphPDF
graph
(default, equivalent todotGraphPDF
)
- Available
type
s (multiple values allowed, comma separated):protocols
(default)structs
classes
Ensure you have SourceKitten properly installed and check its usage guide.
Example:
sourcekitten doc -- -workspace Haneke.xcworkspace -scheme Haneke
Check examples
folder to see some demos.
Run each .sh
file to automatically download and generate the relationsip diagram of each Open Source sample project.
- Improve README
- Add proper error messages
- Add examples
-
Call SourceKitten automatically- Not a priority, better add support to integrate graph generation in an Xcode plugin.
- Improve documentation
- Publish to NPM registry
- Add support for classes' dependency graph
- Made it
-g
-compatible - Add legend
- Add support for generating UML class-like diagrams
- Add unit tests
- Add support for filtering by entity (
tree
mode)
- First version