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> ()); }
private IEnumerable <PaketMetadata> GetDependenciesFromFile(string paketDependenciesFile) { return(DependenciesFile.ReadFromFile(paketDependenciesFile) .DirectDependencies .Select(d => new PaketMetadata(d.Key.Id, d.Value.ToString()))); }
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())))); }