Beispiel #1
0
        private IEnumerable <Package> GetProjectReference(XElement element, string version)
        {
            return(Enumerable.Empty <Package>());

            var packageList      = new List <Package>();
            var regex            = new Regex(@"([\w|\.]+)\.csproj");
            var referenceVersion = ReferenceVersion.Parser(version);

            foreach (var temp in element.DescendantsAndSelf(XName.Get("ProjectReference")))
            {
                var package = temp.Attribute(XName.Get("Include"))?.Value;
                if (!string.IsNullOrEmpty(package))
                {
                    package = regex.Match(package).Groups[1].Value;
                }

                packageList.Add(new Package(package, referenceVersion));
            }

            return(packageList);
        }
Beispiel #2
0
        private static List <Package> GetPackageReference(XElement element)
        {
            var packageList          = new List <Package>();
            var packageReferenceList = new List <string>();

            foreach (var temp in element.DescendantsAndSelf(XName.Get("PackageReference")))
            {
                var package = temp.Attribute(XName.Get("Include"));
                var version = temp.Attribute(XName.Get("Version"));

                if (package == null || version == null)
                {
                    continue;
                }

                packageList.Add(new Package(package.Value, ReferenceVersion.Parser(version.Value)));

                packageReferenceList.Add(temp.ToString());
            }


            return(packageList);
        }