public static bool IsUpdateFor(this IRemoteNuget nuget, Dependency dependency) { var version = dependency.SemanticVersion(); if (version == null) return false; return nuget.Version > version; }
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())); }
public virtual INugetFile Find(Dependency query) { return Dependencies.FirstOrDefault(x => query.MatchesName(x.Name) && x.Version.Equals(query.SemanticVersion())); }
public static bool IsUpdateFor(this IRemoteNuget nuget, Dependency dependency) { return nuget.Version > dependency.SemanticVersion(); }
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()); }
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)); }
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); }
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(); }