Last active
December 18, 2015 12:19
-
-
Save frankshearar/5781906 to your computer and use it in GitHub Desktop.
Visualising package dependencies in Squeak
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| allDeps toDigraph | | |
toDigraph := [:hash | | s | | |
s := WriteStream on: String new. | |
s nextPutAll: 'digraph {'; lf. | |
hash keysAndValuesDo: [:pkg :pkgDeps | | |
pkgDeps do: [:dep | | |
(pkg includesSubString: 'Test') | |
ifTrue: [s nextPutAll: ' "'; nextPutAll: pkg; nextPutAll: '" [color="gray"]'; lf]. | |
s nextPutAll: ' "'; nextPutAll: pkg; nextPutAll: '" -> "'; nextPutAll: dep; nextPutAll: '"'. | |
(pkg includesSubString: 'Test') ifTrue: [s nextPutAll: ' [color="gray"]']. | |
s lf]]. | |
s nextPutAll: '}'. | |
s contents]. | |
allDeps := Dictionary new. | |
DependencyBrowser new in: [:dep| | |
PackageInfo allPackages do: [:p | | depClasses | | |
dep computePackageDependencies: p name. | |
depClasses := (dep instVarNamed: 'classDeps') keys intersection: (p classes collect: #name). | |
allDeps at: p name put: (dep packageDeps)]]. | |
FileStream fileNamed: 'c:\users\frank\squeak-ci\trunkimage-deps.dot' do: [:f | | |
f nextPutAll: (toDigraph value: allDeps)]. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To display the graph, install graphviz and run
(from http://forum.world.st/Byte-1981-online-version-tp4723846p4723918.html )