コード例 #1
0
        public static IEnumerable <Requirements.PackageRequirement> GetPackageRequirements(this Solution solution)
        {
            try {
                var dependenciesFileName = solution.GetPaketDependenciesFile();
                if (dependenciesFileName.IsNotNull)
                {
                    return(DependenciesFile
                           .ReadFromFile(dependenciesFileName)
                           .Groups
                           .FirstOrDefault()
                           .Value
                           .Packages);
                }
            } catch (Exception ex) {
                LoggingService.LogError("GetPaketDependencies error.", ex);
            }

            return(Enumerable.Empty <Requirements.PackageRequirement> ());
        }
コード例 #2
0
 private IEnumerable <PaketMetadata> GetDependenciesFromFile(string paketDependenciesFile)
 {
     return(DependenciesFile.ReadFromFile(paketDependenciesFile)
            .DirectDependencies
            .Select(d => new PaketMetadata(d.Key.Id, d.Value.ToString())));
 }
コード例 #3
0
 private IEnumerable <PaketMetadata> GetDependenciesFromFile(string paketDependenciesFile)
 {
     return(DependenciesFile.ReadFromFile(paketDependenciesFile)
            .Groups
            .SelectMany(g => g.Value.Packages.Select(d => new PaketMetadata(g.Key.ToString(), d.Name.ToString(), d.VersionRequirement.ToString()))));
 }