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


C# Core.BuildEventArgs类代码示例

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


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

示例1: BuildFinished

 public void BuildFinished(object sender, BuildEventArgs e)
 {
     if (e.Exception == null && e.Project == Project)
     {
         GenerateSolutionFile(Project);
     }
 }
开发者ID:skolima,项目名称:generate-msbuild,代码行数:7,代码来源:GenerateMsBuildTask.cs

示例2: TaskFinished

        public void TaskFinished(object sender, BuildEventArgs e)
        {
            var task = (CscTask)e.Task;
            var generator = (GenerateMsBuildTask)sender;
            var projectFileName = String.Format(
                    "{0}{1}{2}.csproj",
                    task.Sources.BaseDirectory.FullName,
                    Path.DirectorySeparatorChar,
                    Path.GetFileNameWithoutExtension(task.OutputFile.Name));

            ProjectRootElement project = null;
            if (!File.Exists(projectFileName))
                project = ProjectRootElement.Create(projectFileName);
            else
                project = ProjectRootElement.Open(projectFileName);
            var projectManipulator = new MB.Project(project);

            project.DefaultTargets = "Build";
            SetKnownProperties(project, task);
            GenerateReferences(project, projectManipulator, task, generator);
            GenerateCompileIncludes(project, projectManipulator, task);
            project.EnsureImportExists("$(MSBuildToolsPath)\\Microsoft.CSharp.targets");

            generator.RegisterProjectInSolution(project);
            project.Save();
        }
开发者ID:skolima,项目名称:generate-msbuild,代码行数:26,代码来源:CscTranslator.cs

示例3: OnMessageLogged

        private static void OnMessageLogged(object sender, BuildEventArgs e)
        {
            if (Loggers.IsEmpty)
            {
                // tiny race.
                ((Project)sender).MessageLogged -= OnMessageLogged;
                return;
            }

            var msg = FormatMessage(e);
            
            if (msg == null)
                return;
            
            foreach (var log in Loggers)
            {
                try
                {
                    log.Value.WriteLine(msg);
                    log.Value.Flush();
                }
                catch (Exception)
                {
                }
                
            }
        }
开发者ID:Xtremrules,项目名称:dot42,代码行数:27,代码来源:RecordTask.cs

示例4: TaskFinished

 public void TaskFinished(object sender, BuildEventArgs e)
 {
     // resources embedded in csc tasks are already handled
     if (typeof(CscTask) != e.Task.Parent.GetType())
     {
         throw new NotImplementedException();
     }
 }
开发者ID:skolima,项目名称:generate-msbuild,代码行数:8,代码来源:ResgenTranslator.cs

示例5: LogEvent

 public LogEvent(String sourceName, Object sender, BuildEventArgs args, LogEventType eventType)
 {
     _sourceName = sourceName;
     _sender = sender;
     _args = args;
     _eventType = eventType;
     _exception = null;
 }
开发者ID:anelson,项目名称:multitask,代码行数:8,代码来源:LogEvent.cs

示例6: BuildStarted

        public void BuildStarted(Object sender, BuildEventArgs be)
        {
            autoTrace = be.Project.Properties.Contains("trace.ant.disableAutoTrace") && be.Project.Properties["trace.ant.disableAutoTrace"].Equals("true", StringComparison.InvariantCultureIgnoreCase);

            TraceManager.BeginTrace();
            if (autoTrace)
                TraceManager.Trace.BeginEntry(String.Format("Start build '{0}'.", be.Project.ProjectName), severityType.INFO);
        }
开发者ID:sapo,项目名称:sapo-services-sdk,代码行数:8,代码来源:NAntListenerTracer.cs

示例7: TaskFinished

 public void TaskFinished(object sender, BuildEventArgs e)
 {
     if (e.Exception == null && !string.IsNullOrEmpty(e.Task.Name))
     {
         if (taskTranslators.ContainsKey(e.Task.Name))
         {
             taskTranslators[e.Task.Name].TaskFinished(this, e);
         }
     }
 }
开发者ID:skolima,项目名称:generate-msbuild,代码行数:10,代码来源:GenerateMsBuildTask.cs

示例8: TaskStarted

        public void TaskStarted(object sender, BuildEventArgs e) {
            _taskStartedFired = true;

            if (e.Task != null) {
                if (_executedTasks.ContainsKey(e.Task.Name)) {
                    _executedTasks[e.Task.Name] = ((int) _executedTasks[e.Task.Name]) + 1;
                } else {
                    _executedTasks.Add(e.Task.Name, 1);
                }
            }
        }
开发者ID:RoastBoy,项目名称:nant,代码行数:11,代码来源:TestBuildListener.cs

示例9: TargetStarted

        public void TargetStarted(object sender, BuildEventArgs e) {
            _targetStartedFired = true;

            if (e.Target != null) {
                if (_executedTargets.ContainsKey(e.Target.Name)) {
                    _executedTargets[e.Target.Name] = ((int) _executedTargets[e.Target.Name]) + 1;
                } else {
                    _executedTargets.Add(e.Target.Name, 1);
                }
                _targetStartTimes[e.Target.Name] = DateTime.UtcNow;
            }
        }
开发者ID:RoastBoy,项目名称:nant,代码行数:12,代码来源:TestBuildListener.cs

示例10: BuildStarted

        public void BuildStarted(object sender, BuildEventArgs e)
        {
            string host = e.Project.Properties[PROP_HOST];

            if (host == null) {
                host = DEFAULT_HOST;
            }

            string port = e.Project.Properties[PROP_PORT];

            if (port == null) {
                port = DEFAULT_PORT;
            }

            int portInt = int.Parse(port);

            reporter = new UdpBuildReporter(host, portInt);

            report("BUILD_STARTED", e);
        }
开发者ID:majianxiong,项目名称:vulcan,代码行数:20,代码来源:NAntListener.cs

示例11: ParseMessage

        public void ParseMessage(BuildEventArgs e, out MessagePriority priority, out string file, out int lineNumber, out string code, out string message)
        {
            switch(e.MessageLevel) {
                case Level.Warning: priority = MessagePriority.WARNING; break;
                case Level.Error: priority = MessagePriority.ERROR; break;
                default: priority = MessagePriority.INFO; break;
            }

            file = null;
            code = null;
            lineNumber = 0;
            message = e.Message;

            Match match = messageRegex.Match(message);
            if (match.Success)
            {
                if (match.Groups["category"].Value == "warning")
                {
                    priority = MessagePriority.WARNING;
                }
                else
                {
                    priority = MessagePriority.ERROR;
                }

                file = match.Groups["file"].Value;

                string lineString = match.Groups["line"].Value;
                if (lineString != "")
                {
                    lineNumber = int.Parse(lineString);
                }

                code = match.Groups["code"].Value;
                message = match.Groups["message"].Value;
            }
        }
开发者ID:majianxiong,项目名称:vulcan,代码行数:37,代码来源:NAntListener.cs

示例12: OutputMessage

        /// <summary>
        /// Outputs an indented message to the build log if its priority is 
        /// greather than or equal to the <see cref="Threshold" /> of the 
        /// logger.
        /// </summary>
        /// <param name="e">The event to output.</param>
        private void OutputMessage(BuildEventArgs e)
        {
            int indentationLength = 0;

            if (e.Project != null) {
                indentationLength = e.Project.IndentationLevel * e.Project.IndentationSize;
            }

            OutputMessage(e, indentationLength);
        }
开发者ID:vardars,项目名称:ci-factory,代码行数:16,代码来源:FileLogListener.cs

示例13: CreateBuildEvent

 private static BuildEventArgs CreateBuildEvent(Level messageLevel, string message)
 {
     BuildEventArgs buildEvent = new BuildEventArgs();
     buildEvent.MessageLevel = messageLevel;
     buildEvent.Message = message;
     return buildEvent;
 }
开发者ID:vardars,项目名称:ci-factory,代码行数:7,代码来源:FileLogListener.cs

示例14: TaskStarted

 /// <summary>
 /// Signals that a task has started.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">A <see cref="BuildEventArgs" /> object that contains the event data.</param>
 public virtual void TaskStarted(object sender, BuildEventArgs e)
 {
 }
开发者ID:vardars,项目名称:ci-factory,代码行数:8,代码来源:FileLogListener.cs

示例15: TaskFinished

 /// <summary>
 /// Signals that a task has finished.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">A <see cref="BuildEventArgs" /> object that contains the event data.</param>
 /// <remarks>
 /// This event will still be fired if an error occurred during the build.
 /// </remarks>
 public virtual void TaskFinished(object sender, BuildEventArgs e)
 {
 }
开发者ID:vardars,项目名称:ci-factory,代码行数:11,代码来源:FileLogListener.cs


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