本文整理汇总了C#中ripple.Model.Dependency类的典型用法代码示例。如果您正苦于以下问题:C# Dependency类的具体用法?C# Dependency怎么用?C# Dependency使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Dependency类属于ripple.Model命名空间,在下文中一共展示了Dependency类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:modulexcite,项目名称:ripple,代码行数:7,代码来源:NugetSearch.cs
示例2: make_float
public void make_float()
{
var dependency = new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed);
dependency.Float();
dependency.IsFloat().ShouldBeTrue();
}
开发者ID:modulexcite,项目名称:ripple,代码行数:7,代码来源:DependencyTester.cs
示例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);
}
开发者ID:4lexm,项目名称:ripple,代码行数:25,代码来源:SolutionPersistence.cs
示例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());
}
开发者ID:bobpace,项目名称:ripple,代码行数:7,代码来源:NugetStepRunnerTester.cs
示例5: IsUpdateFor
public static bool IsUpdateFor(this IRemoteNuget nuget, Dependency dependency)
{
var version = dependency.SemanticVersion();
if (version == null) return false;
return nuget.Version > version;
}
开发者ID:modulexcite,项目名称:ripple,代码行数:7,代码来源:IRemoteNuget.cs
示例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);
}
开发者ID:bobpace,项目名称:ripple,代码行数:7,代码来源:NugetStepRunnerTester.cs
示例7: CopyFor
public NugetPlanRequest CopyFor(Dependency dependency)
{
var request = (NugetPlanRequest) MemberwiseClone();
request.Dependency = dependency;
return request;
}
开发者ID:bobpace,项目名称:ripple,代码行数:7,代码来源:NugetPlanRequest.cs
示例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();
});
}
开发者ID:modulexcite,项目名称:ripple,代码行数:33,代码来源:finding_project_nugets_to_restore.cs
示例9: Find
public NugetResult Find(Solution solution, Dependency dependency)
{
var cache = FeedRegistry.CacheFor(solution);
var nuget = cache.Find(dependency);
return new NugetResult { Nuget = nuget };
}
开发者ID:modulexcite,项目名称:ripple,代码行数:7,代码来源:CacheFinder.cs
示例10: theVersionIs
private void theVersionIs(Dependency dependency, string version)
{
var task = theSolution.Restore(dependency);
task.Wait();
task.Result.Nuget.Version.ShouldEqual(new SemanticVersion(version));
}
开发者ID:modulexcite,项目名称:ripple,代码行数:7,代码来源:finding_project_nugets_to_restore.cs
示例11: UpdateDependency
public void UpdateDependency(Dependency dependency)
{
var existing = _solution.Dependencies.Find(dependency.Name);
dependency.Mode = existing.Mode;
_solution.UpdateDependency(dependency);
}
开发者ID:bobpace,项目名称:ripple,代码行数:7,代码来源:INugetStepRunner.cs
示例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);
}
开发者ID:bobpace,项目名称:ripple,代码行数:26,代码来源:FeedService.cs
示例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);
}
开发者ID:modulexcite,项目名称:ripple,代码行数:30,代码来源:FeedService.cs
示例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);
}
开发者ID:bobpace,项目名称:ripple,代码行数:35,代码来源:finding_solution_nugets_to_restore.cs
示例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);
}
开发者ID:4lexm,项目名称:ripple,代码行数:8,代码来源:DependencyTester.cs
示例16: falls_back_to_default_constraint_for_float
public void falls_back_to_default_constraint_for_float()
{
var dep = new Dependency("FubuCore", UpdateMode.Float);
var solution = new Solution();
solution.AddDependency(dep);
solution.ConstraintFor(dep).ShouldEqual(solution.NuspecSettings.Float);
}
开发者ID:ventaur,项目名称:ripple,代码行数:9,代码来源:SolutionTester.cs
示例17: SetUp
public void SetUp()
{
theDependency = new Dependency("Test");
theStep = new UpdateDependency(theDependency);
theRunner = MockRepository.GenerateStub<INugetStepRunner>();
theStep.Execute(theRunner);
}
开发者ID:modulexcite,项目名称:ripple,代码行数:9,代码来源:UpdateDependencyTester.cs
示例18: buildPlan
private NugetPlan buildPlan(NugetPlanRequest request, Dependency parent = null, int depth = 0)
{
var plan = new NugetPlan();
var target = request.Dependency;
var solution = request.Solution;
var key = target.Copy();
if (key.IsFloat())
{
key = target.AsFloat();
}
if (_planCache.Has(key))
{
return _planCache[key];
}
_planCache.Fill(key, plan);
RippleLog.Info("* Analyzing " + target);
if (target.Version.IsEmpty())
{
var remote = solution.FeedService.NugetFor(solution, target);
target.Version = remote.Version.ToString();
}
if (request.UpdatesCurrentDependency())
{
var configured = solution.Dependencies.Find(target.Name);
var shouldUpdate = (depth != 0 || request.Operation == OperationType.Update) && (request.ForceUpdates || configured.IsFloat());
if (shouldUpdate)
{
plan.AddStep(new UpdateDependency(target));
}
else
{
RippleLog.Info("Warning: This operation requires {0} to be updated to {1} but it is marked as fixed. Use the force option to correct this.".ToFormat(target.Name, target.Version));
}
}
else if(!solution.Dependencies.Has(target.Name))
{
plan.AddStep(new InstallSolutionDependency(target));
}
projectInstallations(plan, parent, request);
var nugetDependencies = solution.FeedService.DependenciesFor(solution, target, target.Mode);
nugetDependencies.Each(x =>
{
var childPlan = buildPlan(request.CopyFor(x), target, depth + 1);
plan.Import(childPlan);
});
return plan;
}
开发者ID:bobpace,项目名称:ripple,代码行数:56,代码来源:NugetPlanBuilder.cs
示例19: Find
public IRemoteNuget Find(Dependency query)
{
var feed = GetNugetFeed();
if (Mode == UpdateMode.Float || query.IsFloat())
{
return feed.FindLatest(query);
}
return feed.Find(query);
}
开发者ID:modulexcite,项目名称:ripple,代码行数:10,代码来源:Feed.cs
示例20: Latest
public INugetFile Latest(Dependency query)
{
IEnumerable<INugetFile> files = Dependencies.Where(x => x.Name == query.Name).ToList();
if (query.Stability == NugetStability.ReleasedOnly)
{
files = files.Where(x => x.Version.SpecialVersion.IsEmpty());
}
return files.OrderByDescending(x => x.Version).FirstOrDefault();
}
开发者ID:bobpace,项目名称:ripple,代码行数:10,代码来源:NugetFolderCache.cs
注:本文中的ripple.Model.Dependency类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论