MCPcopy Index your code
hub / github.com/commitdev/zero / GetDAG

Method GetDAG

internal/config/projectconfig/project_config.go:86–106  ·  view source on GitHub ↗

GetDAG returns a graph of the module names used in this project config

()

Source from the content-addressed store, hash-verified

84
85// GetDAG returns a graph of the module names used in this project config
86func (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
108func NewModule(parameters Parameters, directory string, repository string, source string, dependsOn []string, conditions []Condition) Module {
109 return Module{

Callers 2

modulesWalkCmdFunction · 0.80

Calls

no outgoing calls

Tested by 1