示例#1
0
        public static IEnumerable <PackageInstallSettings> GetPackageInstallSettings(this DotNetProject project)
        {
            try {
                var referencesFileName = project.GetPaketReferencesFile();
                if (referencesFileName.IsNotNull)
                {
                    return(ReferencesFile
                           .FromFile(referencesFileName)
                           .Groups
                           .FirstOrDefault()
                           .Value
                           .NugetPackages);
                }
            } catch (Exception ex) {
                LoggingService.LogError("GetPaketDependencies error.", ex);
            }

            return(Enumerable.Empty <PackageInstallSettings> ());
        }
 private IEnumerable <PaketMetadata> GetDependenciesFromReferencesFile(string paketReferencesFile)
 {
     return(Dependencies.Locate(paketReferencesFile)
            .GetDirectDependencies(ReferencesFile.FromFile(paketReferencesFile))
            .Select(d => new PaketMetadata(d.Item1, d.Item2)));
 }