当前位置: 首页>>代码示例>>C#>>正文


C# Suite.GetParameters方法代码示例

本文整理汇总了C#中Suite.GetParameters方法的典型用法代码示例。如果您正苦于以下问题:C# Suite.GetParameters方法的具体用法?C# Suite.GetParameters怎么用?C# Suite.GetParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Suite的用法示例。


在下文中一共展示了Suite.GetParameters方法的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);
                    }
                }
            }
        }
开发者ID:zvrana,项目名称:bari,代码行数:32,代码来源:PythonBuildScriptDiscovery.cs

示例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();
 }
开发者ID:zvrana,项目名称:bari,代码行数:8,代码来源:PythonScriptedPostProcessorFactory.cs

示例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();
        }
开发者ID:vigoo,项目名称:bari,代码行数:9,代码来源:PythonScriptedPostProcessorFactory.cs

示例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;
        }
开发者ID:zvrana,项目名称:bari,代码行数:10,代码来源:PythonScriptedProjectBuilderFactory.cs

示例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;
        }
开发者ID:vigoo,项目名称:bari,代码行数:10,代码来源:PythonScriptedProjectBuilderFactory.cs

示例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");
            }
        }
开发者ID:vigoo,项目名称:bari,代码行数:53,代码来源:TestCommand.cs


注:本文中的Suite.GetParameters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。