예제 #1
0
        public static bool IsUpdateFor(this IRemoteNuget nuget, Dependency dependency)
        {
            var version = dependency.SemanticVersion();
            if (version == null) return false;

            return nuget.Version > version;
        }
예제 #2
0
 public bool Equals(Dependency other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.Name, Name) && Equals(other.SemanticVersion(), SemanticVersion()));
 }
예제 #3
0
 public virtual INugetFile Find(Dependency query)
 {
     return Dependencies.FirstOrDefault(x => query.MatchesName(x.Name) && x.Version.Equals(query.SemanticVersion()));
 }
예제 #4
0
 public static bool IsUpdateFor(this IRemoteNuget nuget, Dependency dependency)
 {
     return nuget.Version > dependency.SemanticVersion();
 }
예제 #5
0
 public bool Equals(Dependency other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.Name, Name) && Equals(other.SemanticVersion(), SemanticVersion());
 }
예제 #6
0
        private IRemoteNuget nugetFor(Dependency dependency, bool retrying = false)
        {
            IRemoteNuget nuget = null;
            var          feeds = _connectivity.FeedsFor(_solution);

            foreach (var feed in feeds)
            {
                _connectivity.IfOnline(feed, x => nuget = getLatestFromFloatingFeed(x, dependency));
                if (nuget != null)
                {
                    break;
                }

                if (dependency.IsFloat() || dependency.Version.IsEmpty())
                {
                    _connectivity.IfOnline(feed, x => nuget = x.FindLatest(dependency));
                    if (nuget != null && dependency.Version.IsNotEmpty() && nuget.Version < dependency.SemanticVersion())
                    {
                        nuget = null;
                        continue;
                    }

                    if (nuget != null)
                    {
                        break;
                    }
                }

                _connectivity.IfOnline(feed, x => nuget = x.Find(dependency));
                if (nuget != null)
                {
                    break;
                }
            }



            if (nuget == null)
            {
                if (_connectivity.AllOffline(feeds) && !retrying)
                {
                    return(nugetFor(dependency, true));
                }

                feeds.OfType <FloatingFileSystemNugetFeed>()
                .Each(files => files.DumpLatest());

                RippleAssert.Fail("Could not find " + dependency);
            }

            return(remoteOrCached(nuget));
        }
예제 #7
0
        private IRemoteNuget nugetFor(Dependency dependency, bool retrying = false)
        {
            IRemoteNuget nuget = null;
            var feeds = _connectivity.FeedsFor(_solution);
            foreach (var feed in feeds)
            {
                _connectivity.IfOnline(feed, x => nuget = getLatestFromFloatingFeed(x, dependency));
                if (nuget != null) break;

                if (dependency.IsFloat() || dependency.Version.IsEmpty())
                {
                    _connectivity.IfOnline(feed, x => nuget = x.FindLatest(dependency));
                    if (nuget != null && dependency.Version.IsNotEmpty() && nuget.Version < dependency.SemanticVersion())
                    {
                        nuget = null;
                        continue;
                    }

                    if (nuget != null) break;
                }

                _connectivity.IfOnline(feed, x => nuget = x.Find(dependency));
                if (nuget != null) break;
            }

            if (nuget == null)
            {
                if (_connectivity.AllOffline(feeds) && !retrying)
                {
                    return nugetFor(dependency, true);
                }

                feeds.OfType<FloatingFileSystemNugetFeed>()
                    .Each(files => files.DumpLatest());

                RippleAssert.Fail("Could not find " + dependency);
            }

            return remoteOrCached(nuget);
        }
예제 #8
0
        public bool ShouldRestore(Dependency dependency, bool force = false)
        {
            if (!Has(dependency))
            {
                return true;
            }

            if (!force) return false;

            if (dependency.IsFloat()) return true;

            var local = Get(dependency);
            return local.Version != dependency.SemanticVersion();
        }