• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Build类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Build的典型用法代码示例。如果您正苦于以下问题:C# Build类的具体用法?C# Build怎么用?C# Build使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Build类属于命名空间,在下文中一共展示了Build类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Parse

        public Build Parse(string inputXmlData)
        {
            ValidateAndLoadXml(inputXmlData);

            try
            {
                var build = new Build();

                XmlElement integrationProperties = xmlDocument["cruisecontrol"]["integrationProperties"];

                string buildTrigger = integrationProperties["CCNetBuildCondition"].InnerText;
                string buildStatus = integrationProperties["CCNetIntegrationStatus"].InnerText;

                build.Trigger = GetTrigger(buildTrigger);

                build.StartTime = GetStartTime();
                TimeSpan duration = GetBuildDuration();
                build.FinishedTime = build.StartTime + duration;
                build.Status = ParseStatus(buildStatus);

                return build;
            }
            catch (Exception ex)
            {
                throw new CruiseControlRepositoryException(
                    "There was an error parsing the XML-file. " +
                    "Please refer to the inner exception for details.", ex);
            }
        }
开发者ID:ArildF,项目名称:Smeedee,代码行数:29,代码来源:XmlBuildLogParser.cs


示例2: ProBuilds

        public ProBuilds(String champ)
        {
            Builds = new List<Build>();
            String htmlPage = new WebClient().DownloadString("http://lolbuilder.net/" + champ);
            foreach (Match buildsRegex in new Regex("#(build\\-[0-9]+)\">([a-zA-Z ]+) \\(<span class=\"hover-text\" tooltip=\"Seen in up to ([0-9]+)").Matches(htmlPage))
            {
                Build build = new Build();

                Match buildRegex = new Regex(buildsRegex.Groups[1].ToString()).Matches(htmlPage)[1];
                String buildSectionHtml = htmlPage.Substring(buildRegex.Index);

                String summaryHtml = buildSectionHtml.Substring(buildSectionHtml.IndexOf("build-summary-separator separator"));
                summaryHtml = summaryHtml.Substring(0, summaryHtml.IndexOf("build-box starting-items"));
                String startingHtml = buildSectionHtml.Substring(buildSectionHtml.IndexOf("build-box starting-items"));
                startingHtml = startingHtml.Substring(0, startingHtml.IndexOf("build-box early-game"));
                String orderHtml = buildSectionHtml.Substring(buildSectionHtml.IndexOf("build-box early-game"));
                orderHtml = orderHtml.Substring(0, orderHtml.IndexOf("build-box final-items"));
                String finalHtml = buildSectionHtml.Substring(buildSectionHtml.IndexOf("build-box final-items"));
                if (finalHtml.IndexOf("build-app-text") > 0)
                    finalHtml = finalHtml.Substring(0, finalHtml.IndexOf("build-app-text"));

                build.Name = buildsRegex.Groups[2].ToString();
                build.Popularity = buildsRegex.Groups[3].ToString();
                build.Summary = GetItemsFromHtml(summaryHtml);
                build.StartingItems = GetItemsFromHtml(startingHtml);
                build.Order = GetItemsFromHtml(orderHtml);
                build.BestItems = GetItemsFromHtml(finalHtml);

                Builds.Add(build);
            }
        }
开发者ID:wzpyh,项目名称:LeagueSharp,代码行数:31,代码来源:ProBuilds.cs


示例3: shared

        public shared()
        {
            this.firstDate = new DateTime(2000, 10, 10);
            this.secondDate = new DateTime(2000, 10, 11);
            this.failedBuild1 = new Build() { FinishedTime = firstDate, Status = DomainModel.CI.BuildStatus.FinishedWithFailure };
            this.failedBuild2 = new Build() { FinishedTime = firstDate, Status = DomainModel.CI.BuildStatus.FinishedWithFailure };
            this.failedBuild3 = new Build() { FinishedTime = secondDate, Status = DomainModel.CI.BuildStatus.FinishedWithFailure };
            this.successBuild1 = new Build() { FinishedTime = firstDate, Status = DomainModel.CI.BuildStatus.FinishedSuccefully };
            this.successBuild2 = new Build() { FinishedTime = secondDate, Status = DomainModel.CI.BuildStatus.FinishedSuccefully };

            this.project1 = new CIProject("test one");
            project1.AddBuild(failedBuild1);
            project1.AddBuild(successBuild1);

            this.project2 = new CIProject("test two");
            project2.AddBuild(failedBuild2);
            project2.AddBuild(failedBuild3);
            project2.AddBuild(successBuild2);

            this.ciserver = new CIServer("server", "serverurl");
            ciserver.AddProject(project1);
            ciserver.AddProject(project2);

            repository.Setup(r => r.Get(It.IsAny<AllSpecification<CIServer>>()))
                .Returns(new List<CIServer>() { ciserver });
        }
开发者ID:ArildF,项目名称:Smeedee,代码行数:26,代码来源:BuildHistoryControllerSpecs.cs


示例4: Can_dispose_of_configuration_after_usage

 public void Can_dispose_of_configuration_after_usage()
 {
     var conf = new FullConfiguration();
     var parserBuilder = new Build().Configuration(conf);
     parserBuilder.Dispose();
     Assert.That(conf.DisposeCalled);
 }
开发者ID:wallymathieu,项目名称:isop,代码行数:7,代码来源:ConfigurationTests.cs


示例5: deploy

        public void deploy(ArtifactoryBuild task, Build build, BuildInfoLog log) 
        {
            ArtifactoryBuildInfoClient client = new ArtifactoryBuildInfoClient(task.Url, task.User, task.Password, log);
            client.setProxy(build.deployClient);
            client.setConnectionTimeout(build.deployClient);

            try
            {
                if (task.DeployEnabled != null && task.DeployEnabled.Equals("true"))
                {
                    /* Deploy every artifacts from the Map< module.name : artifact.name > => List<DeployDetails> */
                    task.deployableArtifactBuilderMap.ToList().ForEach(entry => entry.Value.ForEach(artifact => client.deployArtifact(artifact)));
                }

                if (task.BuildInfoEnabled != null && task.BuildInfoEnabled.Equals("true"))
                {
                    //Upload Build Info json file to Artifactory
                    log.Info("Uploading build info to Artifactory...");
                    /* Send Build Info  */
                    client.sendBuildInfo(build);
                }
            }
            catch (Exception e)
            {
                log.Error("Exception has append from ArtifactoryBuildInfoClient: " + e.Message, e);
                throw new Exception("Exception has append from ArtifactoryBuildInfoClient: " + e.Message, e);
            }
            finally 
            {
                client.Dispose();
            }         
        }
开发者ID:JFrogDev,项目名称:msbuild-artifactory-plugin,代码行数:32,代码来源:BuildDeploymentHelper.cs


示例6: Parse

        public Build Parse(Project project, HtmlNode[] columns)
        {
            _log.DebugFormat("Parsing a build configuration for {0}", project.Name);

            if (columns.Length != 3)
            {
                throw new TeamcityStatusParseException("The build row had the incorrect number of columns");
            }

            var buildConfigurationColumn = columns[0];
            var buildConfigurationLink = buildConfigurationColumn.SelectSingleNode("a");
            var buildConfigurationUrl = buildConfigurationLink.Attributes["href"].Value;
            var currentBuildLink = columns[1].SelectSingleNode("div/a");

            var build = new Build
            {
                Project = project,
                Name = buildConfigurationLink.InnerText,
                Id = GetId(buildConfigurationUrl),
                State = GetBuildState(buildConfigurationColumn),
                Url = buildConfigurationUrl
            };

            if (currentBuildLink != null)
            {
                build.CurrentBuildNumber = currentBuildLink.InnerText.Replace("#", string.Empty);
                build.CurrentBuildUrl = currentBuildLink.Attributes["href"].Value;
            }

            _log.DebugFormat("Parsed build configuration {0} ({1}) - {2}", build.Name, build.Id, build.State);

            return build;
        }
开发者ID:AlexShkorParalect,项目名称:Teamcity.Rx,代码行数:33,代码来源:BuildRowParser.cs


示例7: Input

 protected override bool Input()
 {
     Console.WriteLine("Please input script name:");
     _Name = Console.ReadLine();
     build = new Build(_DesPath, _Name);
     return true;
 }
开发者ID:Ngauet,项目名称:automatedframework,代码行数:7,代码来源:BuildRelease.cs


示例8: GetRootModelFromBuild

 private Root GetRootModelFromBuild(Build b)
 {
     var server = new Isop.Server.IsopServerFromBuild( ()=> b );
     var data = JsonConvert.SerializeObject(server.GetModel());
     var client = new IsopClient(new JsonHttpClientThatOnlyReturns(data), "http://localhost:666");
     return client.GetModel().Result;
 }
开发者ID:wallymathieu,项目名称:isop-server,代码行数:7,代码来源:SerializationTests.cs


示例9: AnalysisJson

 void AnalysisJson()
 {
     var BuildString = (new WebClient()).DownloadString("https://dewrito.halo.click/api/builds");
     _list = JsonConvert.DeserializeObject<List<JObject>>(BuildString).Select((t) =>
     {
         JArray jar = JArray.Parse(t["artifacts"].ToString());
         Build b = new Build()
         {
             Branch = t["branch"].ToString(),
             BuildVersion = t["buildVersion"].ToString(),
             CommitAuthor = t["commitAuthor"].ToString(),
             CommitId = t["commitId"].ToString(),
             CommitMessage = t["commitMessage"].ToString(),
             downloadUrl = t["downloadUrl"].ToString(),
             CommitDate = Convert.ToDateTime(t["commitDate"])
         };
         for (var i = 0; i < jar.Count; i++)
         {
             JObject j = JObject.Parse(jar[i].ToString());
             b.size = j["size"].ToString();
             b.url = j["url"].ToString();
         }
         return b;
     }).ToList() as List<Build>;
     _list.Reverse();
 }
开发者ID:FDKPIBC,项目名称:Halo-Online-Version-Browser,代码行数:26,代码来源:Form1.cs


示例10: OnBuildStarted

 public static void OnBuildStarted(BuildStarted e, Build view)
 {
     view.buildId = e.Id;
     view.Tasks = new List<TaskInfo>(e.Status.Tasks);
     view.Tasks.ForEach(info => view.TerminalOutput[info.Id] = new List<string>(){""});
     view.Status = Build.BuildOverallStatus.Started;
 }
开发者ID:pshomov,项目名称:frog,代码行数:7,代码来源:BuildProjection.cs


示例11: Controller

 private static Controller Controller(Build that, Type type)
 {
     return new Controller
                {
                    Name = type.ControllerName(),
                    Methods = type.GetControllerActionMethods().Select(m => Method(that, type, m)).ToArray()
                };
 }
开发者ID:Lundalogik,项目名称:isop,代码行数:8,代码来源:BuildExtensions.cs


示例12: AbortBuild

 public void AbortBuild(MergeRequest mergeRequest, Build build)
 {
     var projectClient = client.GetRepository(mergeRequest.SourceProjectId);
     var actualBuild = build ?? projectClient.Builds.GetBuilds().FirstOrDefault();
     if (actualBuild == null || (actualBuild.Status != BuildStatus.pending && actualBuild.Status != BuildStatus.running))
         return;
     projectClient.Builds.Cancel(actualBuild);
 }
开发者ID:Xarlot,项目名称:DXVcs2Git,代码行数:8,代码来源:GitLabWrapper.cs


示例13: Can_generate_tree_model_from_configuration_with_controllers

 public void Can_generate_tree_model_from_configuration_with_controllers()
 {
     var treemodel = new Build()
         .Recognize(new MyController())
         .GetMethodTreeModel();
     Assert.That(treemodel.Controllers.Count(), Is.EqualTo(1));
     Assert.That(treemodel.GlobalParameters.Count(), Is.EqualTo(0));
 }
开发者ID:Lundalogik,项目名称:isop,代码行数:8,代码来源:MethodTreeModelTests.cs


示例14: OnStartup

 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     var path = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location)
         .FullName;
     ParserBuilder = new Build().ConfigurationFrom(
         path);
 }
开发者ID:Lundalogik,项目名称:isop,代码行数:8,代码来源:App.xaml.cs


示例15: Can_read_documentation_for_properties

 public void Can_read_documentation_for_properties()
 {
     var conf = new FullConfiguration();
     var parserBuilder = new Build().Configuration(conf);
     var globalDesc = parserBuilder.GlobalParameters
         .First(gp => gp.Argument.Prototype.Equals("Global")).Description;
     Assert.That(globalDesc, Is.EqualTo("GLOBAL!!"));
 }
开发者ID:wallymathieu,项目名称:isop,代码行数:8,代码来源:ConfigurationTests.cs


示例16: It_can_report_usage_for_actions_with_description

 public void It_can_report_usage_for_actions_with_description()
 {
     var usage = new Build()
                             .Recognize(typeof(DescriptionController))
                             .ShouldRecognizeHelp()
                             .HelpFor("Description","action1");
     Assert.That(LineSplit(usage), Is.EquivalentTo(LineSplit(@"Action1   Some description 1")));
 }
开发者ID:wallymathieu,项目名称:isop,代码行数:8,代码来源:HelpTests.cs


示例17: MethodTreeModel

 public MethodTreeModel(IEnumerable<Param> globalParameters, IEnumerable<Controller> controllers, Build build)
 {
     GlobalParameters=globalParameters;
     Controllers=controllers;
     singleEventHandlerScope = new SingleScopeOnly();
     GlobalParameters.RegisterPropertyChanged(globalValueChanged);
     Build = build;
 }
开发者ID:Lundalogik,项目名称:isop,代码行数:8,代码来源:MethodTreeModel.cs


示例18: Save

 public void Save(string path, Build build)
 {
     XmlSerializer serializer = new XmlSerializer(typeof(Build));
     using (var stream = new FileStream(path, FileMode.Create))
     {
         serializer.Serialize(stream, build);
     }
 }
开发者ID:Arafo,项目名称:Syncopia,代码行数:8,代码来源:BuildNumber.cs


示例19: Main

        private static void Main(string[] args)
        {
            using (var build = new Build()
                .Recognize(typeof(DotGraphController))
                .Recognize(typeof(GraphController))
                .Recognize(typeof(SerializeController)))
            {
                try
                {
                    var parsedMethod = build.Parse(args);
                    if (parsedMethod.UnRecognizedArguments.Any())//Warning:
                    {
                        var unRecognizedArgumentsMessage = string.Format(
                                                               @"Unrecognized arguments:
            {0}
            Did you mean any of these arguments?
            {1}", String.Join(",", parsedMethod.UnRecognizedArguments.Select(unrec => unrec.Value).ToArray()),
                                                               String.Join(",", parsedMethod.ArgumentWithOptions.Select(rec => rec.Name).ToArray()));
                        Console.WriteLine(unRecognizedArgumentsMessage);
                        Environment.Exit(1);
                    }
                    else
                    {
                        parsedMethod.Invoke(Console.Out);
                    }
                }
                catch (TypeConversionFailedException ex)
                {

                    Console.WriteLine(String.Format("Could not convert argument {0} with value {1} to type {2}",
                            ex.Argument, ex.Value, ex.TargetType));
                    if (null != ex.InnerException)
                    {
                        Console.WriteLine("Inner exception: ");
                        Console.WriteLine(ex.InnerException.Message);
                    }
                    Environment.Exit(1);
                }
                catch (MissingArgumentException ex)
                {
                    Console.WriteLine(String.Format("Missing argument(s): {0}", String.Join(", ", ex.Arguments.ToArray())));
                    if (build.RecognizesHelp)
                        Console.WriteLine(build.Help());
                    Environment.Exit(1);
                }
                #if DEBUG
                catch (Exception ex1)
                {
                    Console.WriteLine(string.Join(Environment.NewLine, new object[]
                            {
                                "The invokation failed with exception:",
                                ex1.Message, ex1.StackTrace
                            }));
                    Environment.Exit(1);
                }
                #endif
            }
        }
开发者ID:wallymathieu,项目名称:mejram,代码行数:58,代码来源:Program.cs


示例20: BuildUpdated

        public BuildUpdated(Build entity, IEnumerable<Expression<Func<Build, object>>> updatedValues)
        {
            _buildId = entity.Id;

            foreach (var updatedValue in updatedValues)
            {
                _updatedValues[GetMemberInfo(updatedValue).Member.Name] = updatedValue.Compile().Invoke(entity);
            }
        }
开发者ID:AlexShkorParalect,项目名称:Teamcity.Rx,代码行数:9,代码来源:BuildUpdated.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BuildContext类代码示例发布时间:2022-05-24
下一篇:
C# BufferedTextReader类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap