예제 #1
0
        private IEnumerable <Dependency> findDependenciesFor(Dependency dependency, UpdateMode mode, int depth, SearchLocation location)
        {
            IRemoteNuget nuget = null;

            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
                    nuget = _solution.LocalNuget(dependency.Name);
                    nuget.Dependencies().ToList();

                    RippleLog.Debug(dependency.Name + " already installed");
                }
                catch
                {
                    nuget = null;
                }
            }

            if (nuget == null)
            {
                nuget = NugetFor(dependency);
            }

            var dependencies = new List <Dependency>();

            if (depth != 0)
            {
                var dep         = dependency;
                var markAsFixed = mode == UpdateMode.Fixed || !isFloated(dependency);

                if (dep.IsFloat() && markAsFixed)
                {
                    dep = new Dependency(nuget.Name, nuget.Version, UpdateMode.Fixed);
                }

                dependencies.Add(dep);
            }

            nuget
            .Dependencies()
            .Each(x => dependencies.AddRange(findDependenciesFor(x, mode, depth + 1, location)));

            return(dependencies.OrderBy(x => x.Name));
        }
예제 #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);
        }