本文整理汇总了C#中Project.AddDependency方法的典型用法代码示例。如果您正苦于以下问题:C# Project.AddDependency方法的具体用法?C# Project.AddDependency怎么用?C# Project.AddDependency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project.AddDependency方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
theSolution = new Solution(new SolutionConfig()
{
SourceFolder = "src",
BuildCommand = RippleFileSystem.RakeRunnerFile(),
FastBuildCommand = "rake compile",
Floats = new string[] { "Nug1", "Nug2" },
}, "directory1");
var project1 = new Project("something.csproj");
project1.AddDependency(new NugetDependency("Nug1"));
project1.AddDependency(new NugetDependency("Nug2"));
project1.AddDependency(new NugetDependency("Nug3"));
project1.AddDependency(new NugetDependency("Nug4"));
theSolution.AddProject(project1);
var project2 = new Project("something.csproj");
project2.AddDependency(new NugetDependency("Nug1"));
project2.AddDependency(new NugetDependency("Nug3"));
project2.AddDependency(new NugetDependency("Nug5"));
project2.AddDependency(new NugetDependency("Nug6"));
theSolution.AddProject(project2);
}
示例2: combines_the_dependencies
public void combines_the_dependencies()
{
var solution = new Solution();
solution.AddDependency(new Dependency("Bottles", "1.0.1.1"));
var project = new Project("MyProject.csproj");
project.AddDependency(new Dependency("FubuCore", "1.2.3.4"));
solution.AddProject(project);
solution.Dependencies.ShouldHaveTheSameElementsAs(new Dependency("Bottles", "1.0.1.1"), new Dependency("FubuCore", "1.2.3.4"));
}
示例3: 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");
// explicit dependencies are not overridden
theNugetSpec.Dependencies.Add(new NuspecDependency("Bottles", "1.0.0.0"));
theGroup = new SpecGroup(theNugetSpec, new[] { p1, p2 });
}
示例4: adding_a_project_should_set_the_update_mode_on_all_nuget_dependencies
public void adding_a_project_should_set_the_update_mode_on_all_nuget_dependencies()
{
var solution = new Solution(new SolutionConfig()
{
SourceFolder = "src",
BuildCommand = RippleFileSystem.RakeRunnerFile(),
FastBuildCommand = "rake compile",
Floats = new string[]{"Nug1", "Nug2"},
}, "directory1");
var project = new Project("something.csproj");
project.AddDependency(new NugetDependency("Nug1"));
project.AddDependency(new NugetDependency("Nug2"));
project.AddDependency(new NugetDependency("Nug3"));
project.AddDependency(new NugetDependency("Nug4"));
solution.AddProject(project);
project.FindDependency("Nug1").UpdateMode.ShouldEqual(UpdateMode.Float);
project.FindDependency("Nug2").UpdateMode.ShouldEqual(UpdateMode.Float);
project.FindDependency("Nug3").UpdateMode.ShouldEqual(UpdateMode.Locked);
project.FindDependency("Nug4").UpdateMode.ShouldEqual(UpdateMode.Locked);
}
示例5: get_nuget_directory
public void get_nuget_directory()
{
var solution = new Solution
{
SourceFolder = "source",
Directory = ".".ToFullPath()
};
var storage = new StubNugetStorage();
storage.Add("FubuCore", "0.9.1.37");
solution.UseStorage(storage);
var project = new Project("something.csproj");
var dependency = new Dependency("FubuCore", "0.9.1.37");
project.AddDependency(dependency);
solution.AddProject(project);
var spec = new NugetSpec("FubuCore", "somefile.nuspec");
solution.NugetFolderFor(spec)
.ShouldEqual(".".ToFullPath().AppendPath(solution.PackagesDirectory(), "FubuCore"));
}
示例6: get_nuget_directory
public void get_nuget_directory()
{
var solution = new Solution(new SolutionConfig()
{
SourceFolder = "source"
}, ".".ToFullPath());
var project = new Project("something.csproj");
var dependency = new NugetDependency("FubuCore", "0.9.1.37");
project.AddDependency(dependency);
solution.AddProject(project);
var spec = new NugetSpec("FubuCore", "somefile.nuspec");
solution.NugetFolderFor(spec)
.ShouldEqual(".".ToFullPath().AppendPath(solution.Config.SourceFolder, "packages", "FubuCore.0.9.1.37"));
}
示例7: saving_the_solution_with_changed_projects
public void saving_the_solution_with_changed_projects()
{
var storage = MockRepository.GenerateStub<INugetStorage>();
var solution = new Solution();
var project = new Project("Test.csproj");
solution.AddProject(project);
solution.UseStorage(storage);
project.AddDependency("FubuCore");
solution.Save(true);
storage.AssertWasCalled(x => x.Write(solution));
storage.AssertWasCalled(x => x.Write(project));
}