public void Filter(Solution solution, Dependency dependency, NugetResult result) { if (!dependency.IsFloat() || !result.Found) return; var latest = NugetSearch.FindLatestByName(solution, dependency.Name); if (!latest.Found) { return; } if (latest.Nuget.Version > result.Nuget.Version) { result.Import(latest); } }
public void Filter(Solution solution, Dependency dependency, NugetResult result) { if (!dependency.IsFloat() || !result.Found) { return; } var latest = NugetSearch.FindLatestByName(solution, dependency.Name); if (!latest.Found) { return; } if (latest.Nuget.Version > result.Nuget.Version) { result.Import(latest); } }
public static NugetResult FindNuget(IEnumerable <INugetFeed> feeds, Func <INugetFeed, IRemoteNuget> find) { foreach (var feed in feeds) { try { var nuget = find(feed); if (nuget != null) { return(NugetResult.For(nuget)); } } catch { feed.MarkOffline(); throw; } } return(NugetResult.NotFound()); }
private Task <NugetResult> fill(Solution solution, Dependency dependency, Task <NugetResult> result, LinkedListNode <INugetFinder> node) { var innerTask = result.ContinueWith(task => { NugetResult parent; if (task.IsFaulted) { parent = new NugetResult(); var problem = parent.AddProblem(task.Exception); RippleLog.Debug(problem.Message); if (problem.Exception != null) { RippleLog.Debug(problem.Exception.StackTrace); } } else { parent = task.Result; } if (!parent.Found && node.Next != null) { var finder = node.Next.Value; var inner = finder.Find(solution, dependency); parent.Import(inner); } return(parent); }, TaskContinuationOptions.AttachedToParent); if (node.Next != null) { return(fill(solution, dependency, innerTask, node.Next)); } return(innerTask); }
private NugetResult findLocal(Dependency dependency, SearchLocation location) { var result = new NugetResult(); if (location == SearchLocation.Local && _solution.HasLocalCopy(dependency.Name)) { try { // Try to hit the local zip and read it. Mostly for testing but it'll detect a corrupted local package as well result.Nuget = _solution.LocalNuget(dependency.Name); result.Nuget.Dependencies().ToList(); RippleLog.Debug(dependency.Name + " already installed"); } catch { result.Nuget = null; } } return result; }
public void Import(NugetResult result) { Nuget = result.Nuget; _problems.AddRange(result._problems); }
public void Filter(Solution solution, Dependency dependency, NugetResult result) { // no-op }
private Task<NugetResult> fill(Solution solution, Dependency dependency, Task<NugetResult> result, LinkedListNode<INugetFinder> node) { var innerTask = result.ContinueWith(task => { NugetResult parent; if (task.IsFaulted) { parent = new NugetResult(); var problem = parent.AddProblem(task.Exception); RippleLog.Debug(problem.Message); if (problem.Exception != null) { RippleLog.Debug(problem.Exception.StackTrace); } } else { parent = task.Result; } if (!parent.Found && node.Next != null) { var finder = node.Next.Value; var inner = finder.Find(solution, dependency); parent.Import(inner); } return parent; }, TaskContinuationOptions.AttachedToParent); if (node.Next != null) { return fill(solution, dependency, innerTask, node.Next); } return innerTask; }