public DependencyResolutionResult(IPackageDescriptor descriptor, IEnumerable <ResolvedPackage> successfulPackages, IEnumerable <ResolvedPackage> conflictingPackages, IEnumerable <ResolvedPackage> missingPackages) { Descriptor = descriptor; SuccessfulPackages = successfulPackages.ToList().AsReadOnly(); DiscardedPackages = conflictingPackages.ToList().AsReadOnly(); MissingPackages = missingPackages.ToList().AsReadOnly(); //IsSuccess = !(MissingPackages.Any() || DiscardedPackages.Any()); IsSuccess = !(MissingPackages.Any(x => SuccessfulPackages.None(s => s.Identifier.Name.EqualsNoCase(x.Identifier.Name))) || DiscardedPackages.Any(x => SuccessfulPackages.None(s => s.Identifier.Name.EqualsNoCase(x.Identifier.Name)))); }
public bool PassAudit() { return(MissingPackages.IsEmpty() && ProjectPackages.IsEmpty() && InconsistentPackages.IsEmpty() && UnusedPackages.IsEmpty() && SnapshotPackages.IsEmpty() && MissingPackageReferences.IsEmpty() && DuplicatePackageReferences.IsEmpty() && BindingRedirectMismatchReferences.IsEmpty() && BadProjectRefGuids.IsEmpty() && IllegalNugetTargets.IsEmpty()); }
public string VsCommand() { var sb = new StringBuilder(); UnusedPackages.ForEach(p => sb.AppendFormat("{0} -Project {1}\n", p.VsCommand(), RoslynProject.Name)); MissingPackages.ForEach(p => sb.AppendFormat("{0} -Project {1}\n", p.VsCommand(), RoslynProject.Name)); if (InconsistentPackages != null) { InconsistentPackages.ForEach(p => sb.AppendLine(p.VsCommand())); } // These do not have Visual Studio Commands yet //SnapshotPackages.ForEach(p => sb.AppendFormat("{0} -Project {1}\n", p.VsCommand(), RoslynProject.Name)); //CsprojOnlyReferences.ForEach(p => sb.AppendFormat("{0} -Project {1}\n", p.VsCommand(), RoslynProject.Name)); //ConfigOnlyReferences.ForEach(p => sb.AppendFormat("{0} -Project {1}\n", p.VsCommand(), RoslynProject.Name)); return(sb.ToString()); }
public override string ToString() { var sb = new StringBuilder(); sb.AppendLine(RoslynProject.Name); UnusedPackages.ForEach(p => sb.AppendFormat("\t{0}\n", p)); ProjectPackages.ForEach(p => sb.AppendFormat("\t{0}\n", p)); MissingPackages.ForEach(p => sb.AppendFormat("\t{0}\n", p)); MissingPackageReferences.ForEach(p => sb.AppendFormat("\t{0}\n", p)); BindingRedirectMismatchReferences.ForEach(p => sb.AppendFormat("\t{0}\n", p)); SnapshotPackages.ForEach(p => sb.AppendFormat("\t{0}\n", p)); DuplicatePackageReferences.ForEach(p => sb.AppendFormat("\t{0}\n", p)); BadProjectRefGuids.ForEach(p => sb.AppendFormat("\t{0}\n", p)); IllegalNugetTargets.ForEach(p => sb.AppendFormat("\t{0}\n", p)); if (InconsistentPackages != null) { InconsistentPackages.ForEach(p => sb.AppendFormat("\t{0}\n", p)); } return(sb.ToString()); }