本文整理汇总了C#中IPackageTree类的典型用法代码示例。如果您正苦于以下问题:C# IPackageTree类的具体用法?C# IPackageTree怎么用?C# IPackageTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPackageTree类属于命名空间,在下文中一共展示了IPackageTree类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CheckOut
public override string CheckOut(IPackageTree packageTree, FileSystemInfo destination)
{
SvnUpdateResult result = null;
using (var client = new SvnClient())
{
try
{
var svnOptions = new SvnCheckOutArgs();
if (UseRevision.HasValue)
svnOptions.Revision = new SvnRevision(UseRevision.Value);
client.CheckOut(new SvnUriTarget(new Uri(Url)), destination.FullName, svnOptions, out result);
}
catch (SvnRepositoryIOException sre)
{
HandleExceptions(sre);
}
catch (SvnObstructedUpdateException sue)
{
HandleExceptions(sue);
}
}
return result.Revision.ToString();
}
开发者ID:emmekappa,项目名称:horn_src,代码行数:25,代码来源:SvnSourceControl.cs
示例2: GetBuildMetaData
public IBuildMetaData GetBuildMetaData(IPackageTree packageTree, string buildFile)
{
if (factory == null)
throw new ArgumentNullException("You have not called SetDslFactory on class BooBuildConfigReader");
return CreateBuildMetaData(packageTree.CurrentDirectory, packageTree.FullName);
}
开发者ID:emmekappa,项目名称:horn_src,代码行数:7,代码来源:BooBuildConfigReader.cs
示例3: CalculateDependencies
private BuildTree CalculateDependencies(IPackageTree packageTree, BuildTree currentTree)
{
if (currentTree == null)
{
currentTree = new BuildTree(packageTree);
}
else
{
if (HasACircularDependency(currentTree, packageTree))
{
throw new CircularDependencyException(packageTree.Name);
}
InsertDependenciesBeforeParent(currentTree, packageTree);
}
var buildMetaData = packageTree.GetBuildMetaData(packageTree.Name);
var buildEngine = buildMetaData.BuildEngine;
var dependencies = buildEngine.Dependencies;
foreach (var dependency in dependencies)
{
var package = packageTree.RetrievePackage(dependency);
if (package is NullPackageTree)
throw new UnknownInstallPackageException(string.Format("No package definition exists for dependent package {0}, which is required by {1}.", dependency.PackageName, packageTree.FullName));
CalculateDependencies(package, currentTree);
}
return currentTree;
}
开发者ID:kkozmic,项目名称:horn_src,代码行数:34,代码来源:DependencyTree.cs
示例4: Update
public override string Update(IPackageTree packageTree, FileSystemInfo destination)
{
Console.WriteLine(string.Format("pulling {0} to {1}", packageTree.Name, destination.FullName));
revision = Guid.NewGuid().ToString();
return revision;
}
开发者ID:kkozmic,项目名称:horn_src,代码行数:8,代码来源:GitSourceControlDouble.cs
示例5: PathToBuildTool
public string PathToBuildTool(IPackageTree packageTree, FrameworkVersion version)
{
var path = Path.Combine(packageTree.Root.CurrentDirectory.FullName, "buildengines");
path = Path.Combine(path, "Phantom");
path = Path.Combine(path, "Phantom.exe");
return new FileInfo(path).FullName;
}
开发者ID:kkozmic,项目名称:horn_src,代码行数:8,代码来源:PhantomBuildTool.cs
示例6: CommandLineArguments
public string CommandLineArguments(string pathToBuildFile, BuildEngine buildEngine, IPackageTree packageTree, FrameworkVersion version)
{
Console.WriteLine(pathToBuildFile);
Console.WriteLine(buildEngine);
Console.WriteLine(packageTree);
Console.WriteLine(version);
return string.Empty;
}
开发者ID:emmekappa,项目名称:horn_src,代码行数:9,代码来源:BuildToolStub.cs
示例7: Because
protected override void Because()
{
buildEngine = new BuildEngine(null, "", FrameworkVersion.FrameworkVersion35,
CreateStub<IDependencyDispatcher>());
buildEngine.BuildRootDirectory = "output";
packageTree = MockRepository.GenerateStub<IPackageTree>();
packageTree.Expect(pt => pt.WorkingDirectory).Return(new DirectoryInfo("C:\\temp"));
runner = new MSBuildBuildTool();
}
开发者ID:emmekappa,项目名称:horn_src,代码行数:10,代码来源:MSBuildBuildToolSpecification.cs
示例8: Execute
public void Execute(IPackageTree packageTree, IEnumerable<string> dependencyPaths, Dependency dependency)
{
if (!HasADependencyToUpdate(dependencyPaths))
return;
InfoFormat("Dependency: Executing Dependency Updaters for {0}", packageTree.Name);
var dependentUpdaterContext = new DependentUpdaterContext(packageTree, dependencyPaths, dependency);
updaters.ForEach(updater => updater.Update(dependentUpdaterContext));
}
开发者ID:emmekappa,项目名称:horn_src,代码行数:10,代码来源:DependentUpdaterExecutor.cs
示例9: RevisionData
public RevisionData(IPackageTree packageTree)
{
log.InfoFormat("Reading the current revision for {0}", packageTree.Name);
revisionFileInfo = GetRevisionFile(packageTree);
if (revisionFileInfo.Exists)
return;
revision = "0";
}
开发者ID:emmekappa,项目名称:horn_src,代码行数:11,代码来源:RevisionData.cs
示例10: Because
protected override void Because()
{
packageTree = CreateStub<IPackageTree>();
packageTree.Stub(x => x.WorkingDirectory).Return(new DirectoryInfo(@"C:\"));
buildToolStub = CreateStub<IBuildTool>();
buildEngine = new BuildEngine(buildToolStub, "deeper/than/this/somebuild.file", FrameworkVersion.FrameworkVersion35, CreateStub<IDependencyDispatcher>());
buildEngine.Build(new StubProcessFactory(), packageTree);
}
开发者ID:emmekappa,项目名称:horn_src,代码行数:12,代码来源:BuildEngineSpec.cs
示例11: Before_each_spec
protected override void Before_each_spec()
{
dependencyResolver = CreateStub<IDependencyResolver>();
dependencyResolver.Stub(x => x.Resolve<SVNSourceControl>()).Return(new SVNSourceControl(string.Empty));
IoC.InitializeWith(dependencyResolver);
factory = new DslFactory { BaseDirectory = DirectoryHelper.GetBaseDirectory() };
factory.Register<BooConfigReader>(new ConfigReaderEngine());
packageTree = MockRepository.GenerateStub<IPackageTree>();
}
开发者ID:kkozmic,项目名称:horn_src,代码行数:12,代码来源:BuildWithBatchSpecificationBase.cs
示例12: PrepareRepository
public virtual IRepositoryElement PrepareRepository(IPackageTree packageToExportTo, IGet get)
{
packageTreeToExportTo = packageToExportTo;
var root = packageToExportTo.Root;
var buildMetaData = root.GetBuildMetaData(RepositoryName);
repositoryTree = root.RetrievePackage(RepositoryName);
get.From(buildMetaData.SourceControl).ExportTo(repositoryTree);
return this;
}
开发者ID:kkozmic,项目名称:horn_src,代码行数:13,代码来源:RepositoryElement.cs
示例13: Update
public override string Update(IPackageTree packageTree, FileSystemInfo destination)
{
try
{
RunHGCommand("pull", destination.FullName);
}
catch (Exception ex)
{
HandleExceptions(ex);
}
return CurrentRevisionNumber(destination.FullName);
}
开发者ID:kkozmic,项目名称:horn_src,代码行数:13,代码来源:MercurialSourceControl.cs
示例14: SetDslFactory
public virtual IBuildConfigReader SetDslFactory(IPackageTree packageTree)
{
PackageTree = packageTree;
factory = new DslFactory
{
BaseDirectory = packageTree.CurrentDirectory.FullName
};
factory.Register<BooConfigReader>(new ConfigReaderEngine());
return this;
}
开发者ID:emmekappa,项目名称:horn_src,代码行数:13,代码来源:BooBuildConfigReader.cs
示例15: BuildDependencyTree
protected virtual void BuildDependencyTree(IPackageTree packageTree, IDependencyTree dependencyTree)
{
foreach (var nextTree in dependencyTree)
{
IBuildMetaData nextMetaData = GetBuildMetaData(nextTree);
if (!commandArgs.RebuildOnly)
RetrieveSourceCode(nextMetaData, nextTree);
ExecutePrebuildCommands(nextMetaData, nextTree);
BuildSource(nextTree, nextMetaData);
}
}
开发者ID:kkozmic,项目名称:horn_src,代码行数:14,代码来源:PackageBuilder.cs
示例16: Before_each_spec
protected override void Before_each_spec()
{
dependencyResolver = CreateStub<IDependencyResolver>();
var environmentVariable = CreateStub<IEnvironmentVariable>();
environmentVariable.Stub(x => x.GetDirectoryFor("git.cmd")).Return(Environment.CurrentDirectory);
dependencyResolver.Stub(x => x.Resolve<GitSourceControl>()).Return(new GitSourceControl(environmentVariable));
IoC.InitializeWith(dependencyResolver);
factory = new DslFactory { BaseDirectory = DirectoryHelper.GetBaseDirectory() };
factory.Register<BooConfigReader>(new ConfigReaderEngine());
packageTree = MockRepository.GenerateStub<IPackageTree>();
}
开发者ID:kkozmic,项目名称:horn_src,代码行数:14,代码来源:GitSourceControlSpecificationBase.cs
示例17: CheckOut
public override string CheckOut(IPackageTree packageTree, FileSystemInfo destination)
{
try
{
if (!destination.Exists)
Directory.CreateDirectory(destination.FullName);
RunHGCommand(string.Format("{0} {1} {2}", "clone", Url, destination.FullName), destination.FullName);
}
catch (Exception ex)
{
HandleExceptions(ex);
}
return CurrentRevisionNumber(destination.FullName);
}
开发者ID:kkozmic,项目名称:horn_src,代码行数:15,代码来源:MercurialSourceControl.cs
示例18: Category
public Category(Category parent, IPackageTree packageTreeNode)
{
Categories = new List<Category>();
Packages = new List<Package>();
Name = packageTreeNode.Name;
Parent = parent;
foreach (var buildMetaData in packageTreeNode.GetAllPackageMetaData())
{
Packages.Add(new Package(this, buildMetaData));
}
}
开发者ID:kkozmic,项目名称:horn_src,代码行数:15,代码来源:Category.cs
示例19: CommandLineArguments
public string CommandLineArguments(string pathToBuildFile, BuildEngine buildEngine, IPackageTree packageTree,
FrameworkVersion version)
{
var cmdLine = new StringBuilder();
cmdLine.AppendFormat(
"{0} /p:OutputPath=\"{1}\" /p:TargetFrameworkVersion={2} /p:NoWarn=1591 /consoleloggerparameters:Summary",
pathToBuildFile.QuotePath(), Path.Combine(packageTree.WorkingDirectory.FullName, buildEngine.BuildRootDirectory),
GetFrameworkVersionForBuildTool(version));
AppendTasks(buildEngine, cmdLine);
AppendParameters(buildEngine, cmdLine);
return cmdLine.ToString();
}
开发者ID:emmekappa,项目名称:horn_src,代码行数:15,代码来源:MSBuildBuildTool.cs
示例20: before_each_spec
public override void before_each_spec()
{
var dependencyResolver = MockRepository.GenerateStub<IDependencyResolver>();
fileSystemProvider = MockRepository.GenerateStub<IFileSystemProvider>();
packageBuilder = MockRepository.GenerateStub<IPackageCommand>();
rootPackageTree = MockRepository.GenerateStub<IPackageTree>();
buildMetaData = MockRepository.GenerateStub<IBuildMetaData>();
commandArgs = new CommandArgs("horn", false, null, false, null);
dependencyResolver.Stub(x => x.HasComponent<ICommandArgs>()).Return(true);
dependencyResolver.Stub(x => x.Resolve<ICommandArgs>()).Return(commandArgs);
dependencyResolver.Stub(x => x.Resolve<IPackageCommand>("install")
).Return(packageBuilder);
IoC.InitializeWith(dependencyResolver);
rootPackageTree.Stub(x => x.Result).Return(new DirectoryInfo(@"z:\horn"));
buildMetaData.ProjectInfo= new Dictionary<string, object>();
rootPackageTree.Stub(x => x.GetAllPackageMetaData()).Return(new List<IBuildMetaData> {buildMetaData});
rootPackageTree.Stub(x => x.Name).Return("horn");
var category = new Category(null, rootPackageTree);
fileSystemProvider.Stub(x => x.GetFiles(Arg<DirectoryInfo>.Is.TypeOf, Arg<string>.Is.TypeOf)).Return(
new List<FileInfo>
{
new FileInfo(string.Format("horn-{0}.zip",
new DateTime(2009, 10, 30).ToString(FileSystemProvider.FileDateFormat))),
new FileInfo(string.Format("horn-{0}.zip",
new DateTime(2009, 10, 29).ToString(FileSystemProvider.FileDateFormat))),
new FileInfo(string.Format("horn-{0}.zip",
new DateTime(2009, 10, 31).ToString(FileSystemProvider.FileDateFormat)))
}.ToArray());
package = new PackageDouble(category, buildMetaData);
string zipFileName = string.Format("{0}-{1}.zip", package.Name, DateTime.Now.ToString(FileSystemProvider.FileDateFormat));
fileSystemProvider.Stub(
x => x.ZipFolder(Arg<DirectoryInfo>.Is.TypeOf, Arg<DirectoryInfo>.Is.TypeOf, Arg<string>.Is.TypeOf)).
Return(new FileInfo(zipFileName));
}
开发者ID:emmekappa,项目名称:horn_src,代码行数:48,代码来源:BuildAndZipSpec.cs
注:本文中的IPackageTree类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论