/// <summary> /// Adds the Visual Studio project to the related SlugCIProject to make later looping thru projects easier... /// </summary> private void MergeVSProjectIntoSlugCI() { foreach (Nuke.Common.ProjectModel.Project x in CISession.Solution.AllProjects) { SlugCIProject slugCIProject = CISession.SlugCIConfigObj.GetProjectByName(x.Name); if (slugCIProject == null) { throw new ApplicationException("Trying to match SlugCIConfig Projects with Visual Studio Solution Projects failed. This is unexpected... Visual Studio Project = [" + x.Name + "]"); } slugCIProject.VSProject = x; // Get Framework(s) string framework = x.GetProperty("TargetFramework"); if (framework != null) { slugCIProject.Frameworks.Add(framework); } else { framework = x.GetProperty("TargetFrameworks"); if (framework != null) { slugCIProject.Frameworks.AddRange(framework.Split(";")); } } slugCIProject.AssemblyName = x.GetProperty("AssemblyName"); slugCIProject.PackageId = x.GetProperty("PackageId"); ControlFlow.Assert(!String.IsNullOrEmpty(slugCIProject.AssemblyName), "Unable to locate the Assembly name from the .csproj for project [" + slugCIProject.Name + "]"); } }
/// <summary> /// Returns an exact copy of the current project /// </summary> /// <returns></returns> public SlugCIProject Copy() { SlugCIProject b = new SlugCIProject(); b.AssemblyName = AssemblyName; b.Name = Name; b.Deploy = Deploy; b.Frameworks = Frameworks; b.IsTestProject = IsTestProject; b.HasTypeWriterScripts = HasTypeWriterScripts; return(b); }
public bool Equals([AllowNull] SlugCIProject b) { if (b is null) { return(false); } // Optimization for a common success case. if (Object.ReferenceEquals(this, b)) { return(true); } // If run-time types are not exactly the same, return false. if (this.GetType() != b.GetType()) { return(false); } if (b.Name != Name) { return(false); } if (b.Deploy != Deploy) { return(false); } if (b.Frameworks != Frameworks) { return(false); } if (b.IsTestProject != IsTestProject) { return(false); } if (b.HasTypeWriterScripts != HasTypeWriterScripts) { return(false); } return(true); }
public bool Equals([AllowNull] SlugCIConfig b) { if (b is null) { return(false); } // Optimization for a common success case. if (Object.ReferenceEquals(this, b)) { return(true); } // If run-time types are not exactly the same, return false. if (this.GetType() != b.GetType()) { return(false); } if (b.CodeCoverageThreshold != CodeCoverageThreshold) { return(false); } if (b.DeployFolderUsesSemVer != DeployFolderUsesSemVer) { return(false); } if (b.DeployToAssemblyFolders != DeployToAssemblyFolders) { return(false); } if (b.DeployToVersionedFolder != DeployToVersionedFolder) { return(false); } if (b.DeployAlphaRoot != DeployAlphaRoot) { return(false); } if (b.DeployProdRoot != DeployProdRoot) { return(false); } if (b.DeployDevRoot != DeployDevRoot) { return(false); } if (b.UseCodeCoverage != UseCodeCoverage) { return(false); } if (b.Projects.Count != Projects.Count) { return(false); } if (b.GitRemote != GitRemote) { return(false); } if (b.ConfigStructureVersion != ConfigStructureVersion) { return(false); } // Loop thru projects looking for complete matches foreach (SlugCIProject project in Projects) { // Find project in other object SlugCIProject c = b.Projects.Find(p => p.Name == project.Name); if (c == null) { return(false); } if (c != project) { return(false); } } // Loop thru Angular Projects looking for complete matches foreach (AngularProject project in AngularProjects) { // Find project in other object AngularProject c = b.AngularProjects.Find(p => p.Name == project.Name); if (c == null) { return(false); } if (c != project) { return(false); } } return(true); }