コード例 #1
0
 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))));
 }
コード例 #2
0
 public bool PassAudit()
 {
     return(MissingPackages.IsEmpty() &&
            ProjectPackages.IsEmpty() &&
            InconsistentPackages.IsEmpty() &&
            UnusedPackages.IsEmpty() &&
            SnapshotPackages.IsEmpty() &&
            MissingPackageReferences.IsEmpty() &&
            DuplicatePackageReferences.IsEmpty() &&
            BindingRedirectMismatchReferences.IsEmpty() &&
            BadProjectRefGuids.IsEmpty() &&
            IllegalNugetTargets.IsEmpty());
 }
コード例 #3
0
ファイル: AuditProject.cs プロジェクト: cvent/solution-audit
        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());
        }
コード例 #4
0
        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());
        }