Exemple #1
0
        protected override IPackage ResolveDependency(PackageDependency dependency)
        {
            // See if we have a local copy
            IPackage package = Repository.FindDependency(dependency);

            if (package != null)
            {
                // We have it installed locally
                Logger.Log(MessageLevel.Debug, NuGetResources.Debug_DependencyAlreadyInstalled, dependency);
            }
            else
            {
                // We didn't resolve the dependency so try to retrieve it from the source
                Logger.Log(MessageLevel.Info, NuGetResources.Log_AttemptingToRetrievePackageFromSource, dependency);

                package = SourceRepository.FindDependency(dependency);

                if (package != null)
                {
                    Logger.Log(MessageLevel.Info, NuGetResources.Log_PackageRetrieveSuccessfully);
                }
            }

            return(package);
        }