本文整理汇总了C#中ripple.Model.Solution类的典型用法代码示例。如果您正苦于以下问题:C# Solution类的具体用法?C# Solution怎么用?C# Solution使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Solution类属于ripple.Model命名空间,在下文中一共展示了Solution类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ForSolution
public static PersistenceExpression<Solution> ForSolution(Solution target)
{
var file = "{0}-{1}.config".ToFormat(typeof(Solution).Name, Guid.NewGuid());
var fileSystem = new FileSystem();
if (fileSystem.FileExists(file))
{
fileSystem.DeleteFile(file);
}
var writer = ObjectBlockWriter.Basic(new RippleBlockRegistry());
var contents = writer.Write(target);
Debug.WriteLine(contents);
fileSystem.WriteStringToFile(file, contents);
var reader = SolutionLoader.Reader();
var specification = new PersistenceSpecification<Solution>(x =>
{
var fileContents = fileSystem.ReadStringFromFile(file);
var readValue = Solution.Empty();
reader.Read(readValue, fileContents);
fileSystem.DeleteFile(file);
return readValue;
});
specification.Original = target;
return new PersistenceExpression<Solution>(specification);
}
示例2: 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();
});
}
示例3: SetUp
public void SetUp()
{
theScenario = SolutionGraphScenario.Create(scenario =>
{
scenario.Solution("Test", sln =>
{
sln.LocalDependency("FubuCore", "1.1.0.0");
sln.ProjectDependency("Test1", "FubuCore");
});
});
theSolution = theScenario.Find("Test");
FeedScenario.Create(scenario =>
{
scenario.For(theSolution.Cache.ToFeed())
.Add("FubuCore", "1.1.0.0")
.Add("FubuCore", "1.2.0.0");
scenario.Offline();
});
theBuilder = new NugetPlanBuilder();
theRequest = new NugetPlanRequest
{
Solution = theSolution,
Dependency = new Dependency("FubuCore"),
Operation = OperationType.Update,
ForceUpdates = false
};
}
示例4: SetUp
public void SetUp()
{
FeedScenario.Create(scenario =>
{
scenario.For(Feed.Fubu)
.Add("FubuCore", "1.1.0.0")
.Add("FubuCore", "1.2.0.0");
});
theScenario = SolutionScenario.Create(scenario =>
{
scenario.Solution("Test", sln =>
{
sln.LocalDependency("FubuCore", "1.1.0.0");
sln.ProjectDependency("Test1", "FubuCore");
});
});
theSolution = theScenario.Find("Test");
theBuilder = new NugetPlanBuilder();
var request = new NugetPlanRequest
{
Solution = theSolution,
Dependency = new Dependency("FubuCore"),
Operation = OperationType.Update,
ForceUpdates = false
};
thePlan = theBuilder.PlanFor(request);
}
示例5: SetUp
public void SetUp()
{
FeedScenario.Create(scenario => scenario.For(Feed.Fubu).Add("fubu", "1.2.0.0"));
theScenario = SolutionGraphScenario.Create(scenario =>
{
scenario.Solution("Test", test =>
{
test.SolutionDependency("fubu", "1.0.0.1", UpdateMode.Fixed);
test.LocalDependency("fubu", "1.0.0.1");
});
});
theSolution = theScenario.Find("Test");
theBuilder = new NugetPlanBuilder();
var request = new NugetPlanRequest
{
Solution = theSolution,
Dependency = new Dependency("fubu"),
Operation = OperationType.Update,
ForceUpdates = false
};
thePlan = theBuilder.PlanFor(request);
}
开发者ID:4lexm,项目名称:ripple,代码行数:27,代码来源:updating_to_a_higher_version_of_an_existing_fixed_solution_dependency.cs
示例6: SetUp
public void SetUp()
{
theCacheFeed = new Feed("file://cache");
theFileSystemFeed = new Feed("file://feed");
FeedScenario.Create(scenario =>
{
scenario.For(theCacheFeed)
.Add("Dependency1", "1.0.0.0");
scenario.For(theFileSystemFeed)
.Add("Dependency1", "1.1.0.0");
scenario.For(Feed.NuGetV2)
.Add("Dependency1", "1.0.23.0");
});
theScenario = SolutionGraphScenario.Create(scenario =>
{
scenario.Solution("Test", test =>
{
test.SolutionDependency("Dependency1", "1.1.0.0", UpdateMode.Float);
});
});
theSolution = theScenario.Find("Test");
theSolution.ClearFeeds();
theSolution.AddFeed(theFileSystemFeed);
theSolution.AddFeed(Feed.NuGetV2);
theSolution.UseCache(new InMemoryNugetCache(theCacheFeed));
}
示例7: SetUp
public void SetUp()
{
theSolution = new Solution();
theProject = theSolution.AddProject("Project1");
theRunner = new NugetStepRunner(theSolution);
}
示例8: FeedService
public FeedService(Solution solution)
{
_solution = solution;
_dependenciesCache.OnMissing = key => findDependenciesFor(key.Dependency, key.Mode, SearchLocation.Local);
ServicePointManager.DefaultConnectionLimit = 10;
}
示例9: SetUp
public void SetUp()
{
theSolution = new Solution();
p1 = theSolution.AddProject("MyProject");
p1.AddDependency("Bottles");
p1.AddDependency("FubuCore");
p1.AddDependency("FubuLocalization");
p2 = theSolution.AddProject("MyOtherProject");
p2.AddDependency("FubuMVC.Core");
theSolution.AddDependency(new Dependency("Bottles", "1.0.0.0", UpdateMode.Fixed));
theSolution.AddDependency(new Dependency("FubuCore", "1.1.0.0", UpdateMode.Float));
theSolution.AddDependency(new Dependency("FubuLocalization", "1.2.0.0", UpdateMode.Fixed));
theSolution.AddDependency(new Dependency("FubuMVC.Core", "1.4.0.0", UpdateMode.Fixed));
theNugetSpec = new NugetSpec("MyProject", "myproject.nuspec");
theGroup = new NuspecTemplate(theNugetSpec, new[]
{
new ProjectNuspec(p1, new NugetSpec("MyProject", "MyProject.nuspec")),
new ProjectNuspec(p2, new NugetSpec("MyOtherProject", "MyOtherProject.nuspec"))
});
}
示例10: 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);
}
示例11: SetUp
public void SetUp()
{
theScenario = SolutionGraphScenario.Create(scenario =>
{
scenario.Solution("Test", test =>
{
test.SolutionDependency("FubuCore", "1.2.0.0", UpdateMode.Float);
test.SolutionDependency("UnneededAnywhereButHere", "1.2.0.0", UpdateMode.Float);
test.ProjectDependency("Test1", "FubuCore");
test.ProjectDependency("Test1", "UnneededAnywhereButHere");
test.ProjectDependency("Test2", "FubuCore");
test.LocalDependency("FubuCore", "1.2.0.0");
test.LocalDependency("UnneededAnywhereButHere", "1.2.0.0");
});
});
theSolution = theScenario.Find("Test");
RippleOperation
.With(theSolution)
.Execute<RemoveInput, RemoveCommand>(new RemoveInput { Nuget = "FubuCore", ProjectFlag = "Test1"});
RippleOperation
.With(theSolution)
.Execute<RemoveInput, RemoveCommand>(new RemoveInput { Nuget = "UnneededAnywhereButHere", ProjectFlag = "Test1" });
theSolution = SolutionBuilder.ReadFrom(theScenario.DirectoryForSolution("Test"));
}
示例12: SetUp
public void SetUp()
{
theFinder = MockRepository.GenerateStub<INuspecTemplateFinder>();
theSolution = new Solution();
theSolution.AddProject("Project1");
theSolution.AddProject("Project2");
d1 = new NuspecDependencyToken("DependencyA", "1.0.0.0", VersionConstraint.DefaultFixed);
d2 = new NuspecDependencyToken("DependencyB", "1.0.0.0", VersionConstraint.DefaultFixed);
g1 = new NuspecTemplate(new NugetSpec("Spec1", "Spec1.nuspec"), new[] { ProjectNuspec.For(theSolution.FindProject("Project1")) });
g2 = new NuspecTemplate(new NugetSpec("Spec2", "Spec2.nuspec"), new[] { ProjectNuspec.For(theSolution.FindProject("Project2")) });
theTemplates = new NuspecTemplateCollection(new[] { g1, g2 });
src1 = MockRepository.GenerateStub<INuspecDependencySource>();
src2 = MockRepository.GenerateStub<INuspecDependencySource>();
theFinder.Stub(x => x.Templates(theSolution)).Return(theTemplates);
src1.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g1, theTemplates, theSolution))).Return(new[] { d1 });
src1.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g2, theTemplates, theSolution))).Return(new NuspecDependencyToken[0]);
src2.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g1, theTemplates, theSolution))).Return(new NuspecDependencyToken[0]);
src2.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g2, theTemplates, theSolution))).Return(new[] { d2 });
theGenerator = new NuspecGenerator(theFinder, new[] { src1, src2 });
thePlan = theGenerator.PlanFor(theSolution, new SemanticVersion("1.0.0.0"));
}
示例13: SetUp
public void SetUp()
{
theScenario = SolutionScenario.Create(scenario =>
{
scenario.Solution("Test", test =>
{
test.SolutionDependency("StructureMap", "2.6.3", UpdateMode.Fixed);
test.ProjectDependency("Test", "structuremap");
});
});
theSolution = theScenario.Find("Test");
FeedScenario.Create(scenario =>
{
scenario.For(Feed.Fubu)
.Add("structuremap", "2.6.4.54");
scenario.For(Feed.NuGetV2)
.Add("structuremap", "2.6.3");
});
RippleOperation
.With(theSolution)
.Execute<RestoreInput, RestoreCommand>();
}
示例14: SetUp
public void SetUp()
{
theScenario = SolutionGraphScenario.Create(scenario =>
{
scenario.Solution("Test", test =>
{
test.SolutionDependency("TestNuGet", "1.1.0.1", UpdateMode.Float);
test.ProjectDependency("Test", "TestNuGet");
});
});
theCache = new Feed("cache");
theSolution = theScenario.Find("Test");
theSolution.UseCache(new InMemoryNugetCache(theCache));
FeedScenario.Create(scenario =>
{
scenario.For(theCache)
.Add("TestNuGet", "1.1.0.1");
});
RippleOperation
.With(theSolution)
.Execute<RestoreInput, RestoreCommand>();
}
示例15: SetUp
public void SetUp()
{
theScenario = SolutionScenario.Create(scenario =>
{
scenario.Solution("Test", test =>
{
// Defacto a float
test.ProjectDependency("Test", "Spark");
});
});
theCache = new Feed("cache");
theSolution = theScenario.Find("Test");
theSolution.UseCache(new InMemoryNugetCache(theCache));
FeedScenario.Create(scenario =>
{
scenario.For(theCache)
.Add("Spark", "1.0.0.0");
scenario.For(Feed.NuGetV2)
.Add("Spark", "1.1.0.1");
});
RippleOperation
.With(theSolution)
.Execute<RestoreInput, RestoreCommand>();
}