本文整理汇总了C#中ripple.Model.Dependency类的典型用法代码示例。如果您正苦于以下问题:C# Dependency类的具体用法?C# Dependency怎么用?C# Dependency使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Dependency类属于ripple.Model命名空间,在下文中一共展示了Dependency类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Find
public static Task<NugetResult> Find(Solution solution, Dependency dependency)
{
var finders = Finders.Where(x => x.Matches(dependency)).ToArray();
var search = new NugetSearch(finders);
return search.FindDependency(solution, dependency);
}
示例2: make_float
public void make_float()
{
var dependency = new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed);
dependency.Float();
dependency.IsFloat().ShouldBeTrue();
}
示例3: persists_and_retrieves_the_solution
public void persists_and_retrieves_the_solution()
{
var solution = new Solution
{
Name = "Test",
BuildCommand = "rake",
FastBuildCommand = "rake compile",
Feeds = new[] { Feed.NuGetV2, Feed.NuGetV1 },
Nugets = new[] { new Dependency("FubuCore", "1.0.1.0") }
};
var group = new DependencyGroup();
group.Dependencies.Add(new GroupedDependency("FubuCore"));
solution.Groups.Add(group);
var constrainedDependency = new Dependency("Bottles", "1.0.0.0")
{
VersionConstraint = VersionConstraint.DefaultFloat
};
solution.AddDependency(constrainedDependency);
solution.Nuspecs.Add(new NuspecMap { File = "Temp", Project = "Test"});
CheckXmlPersistence.For(solution);
}
示例4: project_level_dependency
public void project_level_dependency()
{
var dependency = new Dependency("FubuCore", "1.2.0.0", UpdateMode.Fixed);
theRunner.AddProjectDependency("Project1", dependency);
theProject.Dependencies.Find("FubuCore").ShouldEqual(dependency.AsFloat());
}
示例5: IsUpdateFor
public static bool IsUpdateFor(this IRemoteNuget nuget, Dependency dependency)
{
var version = dependency.SemanticVersion();
if (version == null) return false;
return nuget.Version > version;
}
示例6: solution_level_dependency
public void solution_level_dependency()
{
var dependency = new Dependency("FubuCore", "1.2.0.0", UpdateMode.Fixed);
theRunner.AddSolutionDependency(dependency);
theSolution.Dependencies.Find("FubuCore").ShouldEqual(dependency);
}
示例7: CopyFor
public NugetPlanRequest CopyFor(Dependency dependency)
{
var request = (NugetPlanRequest) MemberwiseClone();
request.Dependency = dependency;
return request;
}
示例8: SetUp
public void SetUp()
{
theSolution = new Solution();
theSolution.ClearFeeds();
theSolution.AddFeed(Feed.Fubu);
theSolution.AddFeed(Feed.NuGetV2);
theSolution.AddDependency(fubucore = new Dependency("FubuCore", "1.0.1.201"));
var theProject = new Project("Test.csproj");
theSolution.AddProject(theProject);
theProject.AddDependency(bottles = new Dependency("Bottles"));
theProject.AddDependency(rhinomocks = new Dependency("RhinoMocks", "3.6.1", UpdateMode.Fixed));
theProject.AddDependency(structuremap = new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed));
FeedScenario.Create(scenario =>
{
scenario.For(Feed.Fubu)
.Add("Bottles", "1.0.2.2")
.Add("FubuCore", "1.0.2.232")
.Add("StructureMap", "2.6.4.71");
scenario.For(Feed.NuGetV2)
.Add("RhinoMocks", "3.6.1")
.Add("StructureMap", "2.6.3");
scenario.For(theSolution.Cache.ToFeed());
scenario.Online();
});
}
示例9: Find
public NugetResult Find(Solution solution, Dependency dependency)
{
var cache = FeedRegistry.CacheFor(solution);
var nuget = cache.Find(dependency);
return new NugetResult { Nuget = nuget };
}
示例10: theVersionIs
private void theVersionIs(Dependency dependency, string version)
{
var task = theSolution.Restore(dependency);
task.Wait();
task.Result.Nuget.Version.ShouldEqual(new SemanticVersion(version));
}
示例11: UpdateDependency
public void UpdateDependency(Dependency dependency)
{
var existing = _solution.Dependencies.Find(dependency.Name);
dependency.Mode = existing.Mode;
_solution.UpdateDependency(dependency);
}
示例12: NugetFor
public virtual IRemoteNuget NugetFor(Solution solution, Dependency dependency)
{
IRemoteNuget nuget = null;
var feeds = feedsFor(solution);
foreach (var feed in feeds)
{
nuget = getLatestFromFloatingFeed(feed, dependency);
if (nuget != null) break;
if (dependency.IsFloat() || dependency.Version.IsEmpty())
{
nuget = feed.FindLatest(dependency);
if (nuget != null) break;
}
nuget = feed.Find(dependency);
if (nuget != null) break;
}
if (nuget == null)
{
RippleAssert.Fail("Could not find " + dependency);
}
return remoteOrCached(solution, nuget);
}
示例13: findDependenciesFor
private Task<NugetResult> findDependenciesFor(Dependency dependency, UpdateMode mode, int depth, SearchLocation location, List<Dependency> dependencies)
{
var result = findLocal(dependency, location);
return Task.Factory.StartNew(() =>
{
if (result.Found)
{
processNuget(result.Nuget, dependency, mode, depth, location, dependencies);
return result;
}
var search = NugetSearch.Find(_solution, dependency);
search.ContinueWith(task =>
{
if (!task.Result.Found)
{
return;
}
result.Import(task.Result);
var nuget = task.Result.Nuget;
processNuget(nuget, dependency, mode, depth, location, dependencies);
}, TaskContinuationOptions.NotOnFaulted | TaskContinuationOptions.AttachedToParent);
return result;
}, TaskCreationOptions.AttachedToParent);
}
示例14: SetUp
public void SetUp()
{
theSolution = new Solution();
theSolution.ClearFeeds();
theSolution.AddFeed(Feed.Fubu);
theSolution.AddFeed(Feed.NuGetV2);
theSolution.AddDependency(fubucore = new Dependency("FubuCore", "1.0.1.201"));
var theProject = new Project("Test.csproj");
theSolution.AddProject(theProject);
theProject.AddDependency(bottles = new Dependency("Bottles"));
theProject.AddDependency(rhinomocks = new Dependency("RhinoMocks", "3.6.1", UpdateMode.Fixed));
theProject.AddDependency(structuremap = new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed));
theFubuFeed = MockRepository.GenerateStub<IFloatingFeed>();
theFubuFeed.Stub(x => x.GetLatest()).Return(new IRemoteNuget[]
{
new StubNuget("Bottles", "1.0.2.2"),
new StubNuget("FubuCore", "1.0.2.232"),
new StubNuget("StructureMap", "2.6.4.71"),
});
theNugetFeed = MockRepository.GenerateStub<INugetFeed>();
theNugetFeed.Stub(x => x.Find(rhinomocks)).Return(new StubNuget("RhinoMocks", "3.6.1"));
theNugetFeed.Stub(x => x.Find(structuremap)).Return(new StubNuget("StructureMap", "2.6.3"));
theFeedProvider = MockRepository.GenerateStub<IFeedProvider>();
theFeedProvider.Stub(x => x.For(Feed.Fubu)).Return(theFubuFeed);
theFeedProvider.Stub(x => x.For(Feed.NuGetV2)).Return(theNugetFeed);
FeedRegistry.Stub(theFeedProvider);
}
示例15: equals_uses_semantic_version
public void equals_uses_semantic_version()
{
var dep1 = new Dependency("structuremap", "2.6.3");
var dep2 = new Dependency("structuremap", "2.6.3.0");
dep1.ShouldEqual(dep2);
dep2.ShouldEqual(dep1);
}