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