private List <string> GetAllInstallFilesFromTree() { if (allInstallFilesFromTree != null) { return(allInstallFilesFromTree); } var deps = BuildPreparer.BuildConfigsGraph(rootModuleName, "full-build"); var usedModules = deps.Select(dep => dep.Key.Name).Distinct().ToList(); allInstallFilesFromTree = usedModules.SelectMany(GetAllInstallFiles).ToList(); return(allInstallFilesFromTree); }
public void TestConfigGraph() { using (var env = new TestEnvironment()) { env.CreateRepo("A", new Dictionary <string, DepsData> { { "full-build *default", new DepsData(null, new List <Dep> { new Dep("B"), new Dep("C", null, "client") }) } }); env.CreateRepo("B", new Dictionary <string, DepsData> { { "full-build *default", new DepsData(null, new List <Dep> { new Dep("D") }) } }); env.CreateRepo("C", new Dictionary <string, DepsData> { { "full-build *default", new DepsData(null, new List <Dep> { new Dep("D") }) }, { "client", new DepsData(null, new List <Dep> { new Dep("D", null, "client") }) } }); env.CreateRepo("D", new Dictionary <string, DepsData> { { "full-build *default", new DepsData(null, new List <Dep>()) }, { "client", new DepsData(null, new List <Dep>()) } }); Helper.SetWorkspace(env.RemoteWorkspace); var result = BuildPreparer.BuildConfigsGraph("A", null); Assert.AreEqual(new[] { new Dep("B", null, "full-build"), new Dep("C/client") }, result[new Dep("A", null, "full-build")].ToArray()); Assert.AreEqual(new[] { new Dep("D", null, "full-build") }, result[new Dep("B", null, "full-build")].ToArray()); Assert.AreEqual(new Dep[] { }, result[new Dep("D", null, "full-build")].ToArray()); Assert.AreEqual(new[] { new Dep("D/client") }, result[new Dep("C/client")].ToArray()); Assert.AreEqual(new string[] { }, result[new Dep("D/client")].ToArray()); } }