Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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());
        }
Esempio n. 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);
        }
Esempio n. 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;
        }
Esempio n. 6
0
 public void Import(NugetResult result)
 {
     Nuget = result.Nuget;
     _problems.AddRange(result._problems);
 }
Esempio n. 7
0
 public void Filter(Solution solution, Dependency dependency, NugetResult result)
 {
     // no-op
 }
Esempio n. 8
0
 public void Import(NugetResult result)
 {
     Nuget = result.Nuget;
     _problems.AddRange(result._problems);
 }
Esempio n. 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;
        }