Example #1
0
        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);
            }
        }
Example #2
0
        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);
            }
        }
Example #3
0
        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());
        }
Example #4
0
        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);
        }
Example #5
0
        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;
        }
Example #6
0
 public void Import(NugetResult result)
 {
     Nuget = result.Nuget;
     _problems.AddRange(result._problems);
 }
Example #7
0
 public void Filter(Solution solution, Dependency dependency, NugetResult result)
 {
     // no-op
 }
Example #8
0
 public void Import(NugetResult result)
 {
     Nuget = result.Nuget;
     _problems.AddRange(result._problems);
 }
Example #9
0
        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;
        }