本文整理汇总了C#中Suite.HasParameters方法的典型用法代码示例。如果您正苦于以下问题:C# Suite.HasParameters方法的具体用法?C# Suite.HasParameters怎么用?C# Suite.HasParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Suite
的用法示例。
在下文中一共展示了Suite.HasParameters方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExtendWithDiscoveries
public void ExtendWithDiscoveries(Suite suite)
{
var scriptsDir = suite.SuiteRoot.GetChildDirectory("scripts");
if (scriptsDir != null)
{
BuildScriptMappings mappings;
if (suite.HasParameters("build-scripts"))
{
mappings = suite.GetParameters<BuildScriptMappings>("build-scripts");
}
else
{
mappings = new BuildScriptMappings();
suite.AddParameters("build-scripts", mappings);
}
foreach (var scriptFile in scriptsDir.Files)
{
var ext = Path.GetExtension(scriptFile);
if (ext != null && ext.ToLowerInvariant() == ".py")
{
var script = new SimplePythonBuildScript(
new SuiteRelativePath(Path.Combine("scripts", scriptFile)),
suite.SuiteRoot);
mappings.Add(script.SourceSetName, script);
log.DebugFormat("Discovered build script: {0}", script.Name);
}
}
}
}
示例2: PythonScriptedPostProcessorFactory
public PythonScriptedPostProcessorFactory(Suite suite, IPostProcessorScriptRunner scriptRunner)
{
this.scriptRunner = scriptRunner;
if (suite.HasParameters("post-processor-scripts"))
scriptMappings = suite.GetParameters<PostProcessorScriptMappings>("post-processor-scripts");
else
scriptMappings = new PostProcessorScriptMappings();
}
示例3: PythonScriptedPostProcessorFactory
public PythonScriptedPostProcessorFactory(Suite suite, IPythonScriptedBuilderFactory builderFactory)
{
this.builderFactory = builderFactory;
if (suite.HasParameters("post-processor-scripts"))
scriptMappings = suite.GetParameters<PostProcessorScriptMappings>("post-processor-scripts");
else
scriptMappings = new PostProcessorScriptMappings();
}
示例4: PythonScriptedProjectBuilderFactory
public PythonScriptedProjectBuilderFactory(Suite suite, ISourceSetFingerprintFactory fingerprintFactory, IProjectBuildScriptRunner scriptRunner)
{
if (suite.HasParameters("build-scripts"))
buildScriptMappings = suite.GetParameters<BuildScriptMappings>("build-scripts");
else
buildScriptMappings = new BuildScriptMappings();
this.fingerprintFactory = fingerprintFactory;
this.scriptRunner = scriptRunner;
}
示例5: PythonScriptedProjectBuilderFactory
public PythonScriptedProjectBuilderFactory(Suite suite, IPythonScriptedBuilderFactory builderFactory, ICoreBuilderFactory coreBuilderFactory)
{
if (suite.HasParameters("build-scripts"))
buildScriptMappings = suite.GetParameters<BuildScriptMappings>("build-scripts");
else
buildScriptMappings = new BuildScriptMappings();
this.builderFactory = builderFactory;
this.coreBuilderFactory = coreBuilderFactory;
}
示例6: Run
/// <summary>
/// Runs the command
/// </summary>
/// <param name="suite">The current suite model the command is applied to</param>
/// <param name="parameters">Parameters given to the command (in unprocessed form)</param>
public bool Run(Suite suite, string[] parameters)
{
int effectiveLength = parameters.Length;
bool dumpMode = false;
bool dumpDepsMode = false;
if (effectiveLength > 0)
{
dumpMode = parameters[effectiveLength - 1] == "--dump";
dumpDepsMode = parameters[effectiveLength - 1] == "--dump-deps";
}
if (dumpMode || dumpDepsMode)
effectiveLength--;
if (effectiveLength < 2)
{
string targetStr;
if (effectiveLength == 0)
targetStr = String.Empty;
else
targetStr = parameters[0];
try
{
lastBuildTarget = targetStr;
var target = targetParser.ParseTarget(targetStr);
var projects = target.TestProjects.ToList();
var tests = suite.HasParameters("test") ? suite.GetParameters<Tests>("test") : new Tests();
var buildOutputs = RunWithProjects(projects, dumpMode, dumpDepsMode).ToList();
if (buildOutputs.Any())
return RunTests(tests, projects, buildOutputs);
else
return false;
}
catch (ArgumentException ex)
{
throw new InvalidCommandParameterException("build", ex.Message);
}
}
else
{
throw new InvalidCommandParameterException("test", "Test must be called without any parameters");
}
}