Merge pull request #36 from safing/feature/subsystems-print-groups

Print subsystem module group in addition to subsystem dep graph
This commit is contained in:
Daniel 2020-05-04 10:55:31 +02:00 committed by GitHub
commit 04ba80d41a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,6 +101,8 @@ func SetDatabaseKeySpace(keySpace string) {
} }
func printGraph() { func printGraph() {
fmt.Println("subsystems dependency graph:")
// unmark subsystems module // unmark subsystems module
module.Disable() module.Disable()
// mark roots // mark roots
@ -111,6 +113,15 @@ func printGraph() {
for _, sub := range subsystems { for _, sub := range subsystems {
printModuleGraph("", sub.module, true) printModuleGraph("", sub.module, true)
} }
fmt.Println("\nsubsystem module groups:")
_ = start() // no errors for what we need here
for _, sub := range subsystems {
fmt.Printf("├── %s\n", sub.Name)
for _, mod := range sub.Modules[1:] {
fmt.Printf("│ ├── %s\n", mod.Name)
}
}
} }
func printModuleGraph(prefix string, module *modules.Module, root bool) { func printModuleGraph(prefix string, module *modules.Module, root bool) {