本文整理汇总了C#中IParameters.Required方法的典型用法代码示例。如果您正苦于以下问题:C# IParameters.Required方法的具体用法?C# IParameters.Required怎么用?C# IParameters.Required使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParameters
的用法示例。
在下文中一共展示了IParameters.Required方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Targets
public static object Targets(IParameters parameters)
{
var stage = parameters.Required<string>("stage");
var machine = parameters.Required<string>("machine");
var deployService = new Copy {
FromPath = "service",
ToPath = machine.WhenBuilt(m => String.Format(@"c:\deployments\install\{0}\service", m)),
};
var deployWeb = new Copy {
FromPath = "web",
ToPath = machine.WhenBuilt(m => String.Format(@"c:\deployments\install\{0}\web", m)),
};
var remoteMachineOne = GetRemoteMachine(stage, machine, "one");
var remoteMachineTwo = GetRemoteMachine(stage, machine, "two");
Task<IEnumerable<RemoteMachine>> serviceMachines = new[] {remoteMachineOne, remoteMachineTwo};
Task<IEnumerable<RemoteMachine>> webMachines = new[] {remoteMachineTwo};
var deployArchive = new StagedDeployArchive(stage, "archive");
var service = deployArchive.Add("service", "service", deployService).WithRemoteDeploy(serviceMachines.SelectTasks(m => m.DeployTargets("Service")));
var web = deployArchive.Add("web", "web", deployWeb).WithRemoteDeploy(webMachines.SelectTasks(m => m.DeployTargets("Web")));
return new {
Service = service,
Web = web,
};
}
示例2: RealTargets
public static object RealTargets(IParameters buildParameters)
{
var version = buildParameters.Required<string>("version");
var git = new GitCheckout {
Repository = "git://github.com/refractalize/bounce.git",
Directory = "tmp2",
};
var solution = new VisualStudioSolution {
SolutionPath = "Bounce.sln",
};
var frameworkProject = solution.Projects["Bounce.Framework"];
var downloadsDir = new CleanDirectory {
Path = "Downloads",
};
var frameworkZip = new ZipFile {
Directory = frameworkProject.WhenBuilt(() => Path.GetDirectoryName(frameworkProject.OutputFile.Value)),
ZipFileName = downloadsDir.Files[version.WhenBuilt(() => string.Format("Bounce.Framework.{0}.zip", version.Value))],
};
var downloads = new All(frameworkZip, new GitTag {Directory = ".", Tag = version.WhenBuilt(() => "v" + version.Value)});
return new {
Tests = new NUnitTests {
DllPaths = solution.Projects.Select(p => p.OutputFile),
},
Downloads = downloads,
};
}
示例3: GetTargets
public static object GetTargets(IParameters parameters) {
var one = new FakeTask {Dependencies = new [] {new TaskDependency (parameters.Required<int>("port"))}};
var two = new FakeTask {Dependencies = new [] {new TaskDependency (parameters.Default("name", "Some Web Site"))}};
return new {
One = one,
Two = two,
};
}
示例4: GetTargets
public static object GetTargets(IParameters parameters)
{
var machineName = parameters.Required<string>("machineName");
var remoteOne = new PrintTask(Output) {Description = machineName};
var two = new PrintTask(Output) {Description = parameters.Required<string>("two")};
var remoteBounce = new RemoteBounce();
RemoteBounceArguments remoteOneArgs = remoteBounce.ArgumentsForTargets(new { RemoteOne = remoteOne });
Task<IEnumerable<string>> machines = new [] {"machine1", "machine2"};
var one = machines.SelectTasks(machine => new RemoteExec {
BounceArguments = remoteOneArgs.WithParameter(machineName.WithValue(machine)),
Machine = machine,
});
return remoteBounce.WithRemoteTargets(new {
One = one,
Two = two,
});
}
示例5: GetTargets
public static object GetTargets(IParameters parameters)
{
var one = new PrintTask(Output) { Description = parameters.Required<string>("one") };
var two = new PrintTask(Output) { Description = parameters.Required<string>("two") };
return new {
One = one,
Two = two,
};
}