Ejemplo n.º 1
0
        private static void Dfs(Dep dep, Dictionary <Dep, List <Dep> > graph, HashSet <Dep> visitedConfigurations)
        {
            dep.UpdateConfigurationIfNull();

            if (Yaml.Exists(dep.Name) && !Yaml.ConfigurationParser(dep.Name).ConfigurationExists(dep.Configuration))
            {
                ConsoleWriter.WriteWarning($"Configuration '{dep.Configuration}' was not found in {dep.Name}. Will take full-build config");
                dep.Configuration = "full-build";
            }

            visitedConfigurations.Add(dep);
            graph[dep] = new List <Dep>();
            if (!Directory.Exists(Path.Combine(Helper.CurrentWorkspace, dep.Name)))
            {
                throw new CementBuildException("Failed to find module '" + dep.Name + "'");
            }
            var currentDeps = new DepsParser(Path.Combine(Helper.CurrentWorkspace, dep.Name)).Get(dep.Configuration).Deps ?? new List <Dep>();

            currentDeps = currentDeps.Select(d => new Dep(d.Name, null, d.Configuration)).ToList();
            foreach (var d in currentDeps)
            {
                d.UpdateConfigurationIfNull();
                graph[dep].Add(d);
                if (!visitedConfigurations.Contains(d))
                {
                    Dfs(d, graph, visitedConfigurations);
                }
            }
        }
Ejemplo n.º 2
0
        private static void Dfs(Dep dep, Dictionary <Dep, List <Dep> > graph, HashSet <Dep> visitedConfigurations)
        {
            CheckAndUpdateDepConfiguration(dep);
            visitedConfigurations.Add(dep);
            graph[dep] = new List <Dep>();
            var currentDeps = new DepsParser(Path.Combine(Helper.CurrentWorkspace, dep.Name)).Get(dep.Configuration).Deps ?? new List <Dep>();

            currentDeps = currentDeps.Select(d => new Dep(d.Name, null, d.Configuration)).ToList();
            foreach (var d in currentDeps)
            {
                d.UpdateConfigurationIfNull();
                graph[dep].Add(d);
                if (!visitedConfigurations.Contains(d))
                {
                    Dfs(d, graph, visitedConfigurations);
                }
            }
        }