GetDAG returns a graph of the module names used in this project config
()
| 84 | |
| 85 | // GetDAG returns a graph of the module names used in this project config |
| 86 | func (c *ZeroProjectConfig) GetDAG() dag.AcyclicGraph { |
| 87 | var g dag.AcyclicGraph |
| 88 | |
| 89 | // Add vertices to graph |
| 90 | g.Add(GraphRootName) |
| 91 | for name := range c.Modules { |
| 92 | g.Add(name) |
| 93 | } |
| 94 | |
| 95 | // Connect modules in graph |
| 96 | for name, m := range c.Modules { |
| 97 | if len(m.DependsOn) == 0 { |
| 98 | g.Connect(dag.BasicEdge(GraphRootName, name)) |
| 99 | } else { |
| 100 | for _, dependencyName := range m.DependsOn { |
| 101 | g.Connect(dag.BasicEdge(dependencyName, name)) |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | return g |
| 106 | } |
| 107 | |
| 108 | func NewModule(parameters Parameters, directory string, repository string, source string, dependsOn []string, conditions []Condition) Module { |
| 109 | return Module{ |
no outgoing calls