public TcProject Parse(string xml) { xElement = XElement.Parse(xml); var id = xElement.AttributeValue("id"); var tcProject = new TcProject(id); var xElements = xElement.Elements("build-type"); xElements.ForEach(AddBuildConfigurationToProject(tcProject)); return tcProject; }
public void SetUp() { path = "path"; tcProjects = new TcProjects(); var tcProject1 = new TcProject("Project1"); var blankList = new List<string>(); tcProject1.BuildConfigurations.Add(new TcBuildConfiguration("BC1", "Build", blankList, blankList, true, null)); tcProject1.BuildConfigurations.Add(new TcBuildConfiguration("BC2", "UnitTest", new List<string> { "BC1" }, blankList, false, null)); tcProject1.BuildConfigurations.Add(new TcBuildConfiguration("BC3", "Artifacts", new List<string> { "BC2" }, new List<string> { "BC4", "BC5" }, false, null)); tcProject1.BuildConfigurations.Add(new TcBuildConfiguration("BC4", "ContractTest1", blankList, blankList, false, null)); tcProject1.BuildConfigurations.Add(new TcBuildConfiguration("BC5", "ContractTest2", blankList, blankList, false, null)); tcProjects.Add(tcProject1); }
private Action<XElement> AddBuildConfigurationToProject(TcProject tcProject) { return x => { var id = x.AttributeValueOrEmpty("id"); var name = x.AttributeValueOrEmpty("name"); var dependsOn = GetDependsOn(x); var snapshotDependency = GetSnapshotDependency(x); var artifactsDependency = GetArtifactsDependency(x); bool isVcsTriggered = IsVcsTriggered(x); tcProject.BuildConfigurations.Add( new TcBuildConfiguration(id, name, dependsOn, snapshotDependency, isVcsTriggered, artifactsDependency) { IsPinnedConfiguration = name.Equals("Pin")}); }; }
public OutputFile(TcProject projName, string buildConfName, string finalString) { ProjName = projName; BuildConfName = buildConfName; FinalString = finalString; }
private List<TcBuildConfiguration> GetBuildConfigurationsToStartDrillingFrom(TcProject tcProject) { var list = new List<TcBuildConfiguration>(); var buildConfigurations = tcProject.BuildConfigurations.FindAll(bc => bc.IsVcsTriggered || bc.IsPinnedConfiguration); buildConfigurations.ForEach(bc => list.Add(bc)); return list; }