示例#1
0
        private void ProcessAsyncBuildRequest()
        {
            if (BuildManager.asyncBuildRequestQueue.CountIsLessThan <BuildManager.BuildRequest>(1) || BuildManager.building)
            {
                return;
            }
            BuildManager.BuildRequest buildRequest = BuildManager.asyncBuildRequestQueue.Peek();
            this.StartBuildCore(buildRequest);
            HostLogger hostLogger = null;

            if (buildRequest.DisplayOutput)
            {
                this.serviceProvider.MessageLoggingService().Clear();
                IMessageLoggingService messageLoggingService = this.serviceProvider.MessageLoggingService();
                CultureInfo            currentCulture        = CultureInfo.CurrentCulture;
                string   projectBuildStartedMessage          = StringTable.ProjectBuildStartedMessage;
                object[] displayName = new object[] { buildRequest.BuildContext.DisplayName, string.Join("; ", buildRequest.Targets) };
                messageLoggingService.WriteLine(string.Format(currentCulture, projectBuildStartedMessage, displayName));
                hostLogger = new HostLogger(buildRequest.BuildContext, this.serviceProvider)
                {
                    Verbosity = (Keyboard.IsKeyDown(Key.RightCtrl) ? LoggerVerbosity.Diagnostic : LoggerVerbosity.Minimal)
                };
            }
            BuildManager.ProjectBuilder projectBuilder = new BuildManager.ProjectBuilder(this, buildRequest, hostLogger, buildRequest.DisplayOutput, false);
            Thread thread = new Thread(new ThreadStart(projectBuilder.Build));

            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
            BuildManager.currentBuildThread = thread;
            projectBuilder.PollBuildThread(thread);
        }
示例#2
0
 internal ProjectBuilder(BuildManager buildManager, BuildManager.BuildRequest request, ILogger logger, bool displayFeedback, bool blockUntilComplete)
 {
     this.buildManager       = buildManager;
     this.buildRequest       = request;
     this.logger             = logger;
     this.displayFeedback    = displayFeedback;
     this.blockUntilComplete = blockUntilComplete;
     this.serviceProvider    = this.buildManager.serviceProvider;
 }
示例#3
0
 private void OnBuildCompleted(BuildCompletedEventArgs args, BuildManager.BuildRequest buildRequest)
 {
     if (!BuildManager.notificationsDisabled && this.BuildCompleted != null)
     {
         this.BuildCompleted(this, args);
     }
     if (BuildManager.asyncBuildRequestQueue.CountIsMoreThan <BuildManager.BuildRequest>(0) && BuildManager.asyncBuildRequestQueue.Peek() == buildRequest)
     {
         BuildManager.asyncBuildRequestQueue.Dequeue();
         this.ProcessAsyncBuildRequest();
     }
 }
示例#4
0
 private void BuildCore(BuildManager.BuildRequest request, bool blockUntilComplete)
 {
     PerformanceUtility.StartPerformanceSequence(PerformanceEvent.ProjectBuild);
     if (!blockUntilComplete)
     {
         BuildManager.asyncBuildRequestQueue.Enqueue(request);
         this.ProcessAsyncBuildRequest();
         return;
     }
     this.StartBuildCore(request);
     (new BuildManager.ProjectBuilder(this, request, null, false, true)).Build();
 }
示例#5
0
 internal BuildInfo(BuildManager.BuildRequest buildRequest, BuildResult buildResult, Exception exception)
 {
     this.BuildRequest = buildRequest;
     this.BuildResult  = buildResult;
     this.Exception    = exception;
 }
示例#6
0
 private void StartBuildCore(BuildManager.BuildRequest request)
 {
     BuildManager.building = true;
     this.OnBuildStarting(new BuildStartingEventArgs(request.BuildContext, request.DisplayOutput));
     request.BuildContext.BuildErrors.Clear();
 }