Example #1
0
 public void RegisterDependencyType()
 {
     if (DependencyGraph == null)
     {
         return;
     }
     BuildPhaseUtility.RunBuildSteps(
         Processor.BuildSteps,
         buildStep =>
     {
         if (buildStep is ISupportIncrementalBuildStep)
         {
             Logger.LogVerbose($"Processor {Processor.Name}, step {buildStep.Name}: Registering DependencyType...");
             using (new LoggerPhaseScope(buildStep.Name, LogLevel.Diagnostic))
             {
                 var types = (buildStep as ISupportIncrementalBuildStep).GetDependencyTypesToRegister();
                 if (types == null)
                 {
                     return;
                 }
                 DependencyGraph.RegisterDependencyType(types);
             }
         }
     });
 }
 private static void BuildArticle(HostService hostService, int maxParallelism)
 {
     using (var aggregatedPerformanceScope = new AggregatedPerformanceScope())
     {
         hostService.Models.RunAll(
             m =>
         {
             using (new LoggerFileScope(m.LocalPathFromRoot))
             {
                 Logger.LogDiagnostic($"Processor {hostService.Processor.Name}: Building...");
                 BuildPhaseUtility.RunBuildSteps(
                     hostService.Processor.BuildSteps,
                     buildStep =>
                 {
                     Logger.LogDiagnostic($"Processor {hostService.Processor.Name}, step {buildStep.Name}: Building...");
                     using (new LoggerPhaseScope(buildStep.Name, LogLevel.Diagnostic, aggregatedPerformanceScope))
                     {
                         buildStep.Build(m, hostService);
                     }
                 });
             }
         },
             maxParallelism);
     }
 }
        private void PostHandle(List <HostService> hostServices)
        {
            using (new LoggerPhaseScope("ProcessUnloadedTemplateDependency", LogLevel.Verbose))
            {
                ProcessUnloadedTemplateDependency(hostServices);
            }

            using (new LoggerPhaseScope("UpdateManifest", LogLevel.Verbose))
            {
                UpdateManifest();
            }

            using (new LoggerPhaseScope("UpdateFileMap", LogLevel.Verbose))
            {
                UpdateFileMap(hostServices);
            }

            using (new LoggerPhaseScope("UpdateXrefMap", LogLevel.Verbose))
            {
                UpdateXrefMap(hostServices);
            }

            using (new LoggerPhaseScope("SaveContextInfo", LogLevel.Verbose))
            {
                SaveContextInfo(hostServices);
            }

            using (new LoggerPhaseScope("RelayBuildMessage", LogLevel.Verbose))
            {
                BuildPhaseUtility.RelayBuildMessage(IncrementalContext, hostServices, Phase);
            }

            Logger.UnregisterListener(CurrentBuildMessageInfo.GetListener());
        }
Example #4
0
 public CompilePhaseHandlerWithIncremental(CompilePhaseHandler inner)
 {
     _inner                  = inner ?? throw new ArgumentNullException(nameof(inner));
     Context                 = _inner.Context;
     IncrementalContext      = Context.IncrementalBuildContext;
     LastBuildVersionInfo    = IncrementalContext.LastBuildVersionInfo;
     LastBuildMessageInfo    = BuildPhaseUtility.GetPhaseMessageInfo(LastBuildVersionInfo?.BuildMessage, Phase);
     CurrentBuildVersionInfo = IncrementalContext.CurrentBuildVersionInfo;
     CurrentBuildMessageInfo = BuildPhaseUtility.GetPhaseMessageInfo(CurrentBuildVersionInfo.BuildMessage, Phase);
 }
Example #5
0
 private static void Postbuild(HostService hostService)
 {
     BuildPhaseUtility.RunBuildSteps(
         hostService.Processor.BuildSteps,
         buildStep =>
     {
         Logger.LogVerbose($"Processor {hostService.Processor.Name}, step {buildStep.Name}: Postbuilding...");
         using (new LoggerPhaseScope(buildStep.Name, LogLevel.Verbose))
         {
             buildStep.Postbuild(hostService.Models, hostService);
         }
     });
 }
Example #6
0
 private void PostHandle(List <HostService> hostServices)
 {
     ReportReference(hostServices);
     ReportDependency(hostServices);
     UpdateTocRestructions(hostServices);
     CurrentBuildVersionInfo.Dependency.ResolveReference();
     foreach (var h in hostServices.Where(h => h.ShouldTraceIncrementalInfo))
     {
         h.SaveIntermediateModel(IncrementalContext);
     }
     IncrementalContext.UpdateBuildVersionInfoPerDependencyGraph();
     BuildPhaseUtility.RelayBuildMessage(IncrementalContext, hostServices, Phase);
     Logger.UnregisterListener(CurrentBuildMessageInfo.GetListener());
 }
Example #7
0
 public LinkPhaseHandlerWithIncremental(LinkPhaseHandler inner)
 {
     if (inner == null)
     {
         throw new ArgumentNullException(nameof(inner));
     }
     _inner                  = inner;
     Context                 = _inner.Context;
     TemplateProcessor       = _inner.TemplateProcessor;
     IncrementalContext      = Context.IncrementalBuildContext;
     LastBuildVersionInfo    = IncrementalContext.LastBuildVersionInfo;
     LastBuildMessageInfo    = BuildPhaseUtility.GetPhaseMessageInfo(LastBuildVersionInfo?.BuildMessage, Phase);
     CurrentBuildVersionInfo = IncrementalContext.CurrentBuildVersionInfo;
     CurrentBuildMessageInfo = BuildPhaseUtility.GetPhaseMessageInfo(CurrentBuildVersionInfo.BuildMessage, Phase);
 }
Example #8
0
 private static void Prebuild(HostService hostService)
 {
     BuildPhaseUtility.RunBuildSteps(
         hostService.Processor.BuildSteps,
         buildStep =>
     {
         Logger.LogVerbose($"Processor {hostService.Processor.Name}, step {buildStep.Name}: Prebuilding...");
         using (new LoggerPhaseScope(buildStep.Name, LogLevel.Verbose))
         {
             var models = buildStep.Prebuild(hostService.Models, hostService);
             if (!object.ReferenceEquals(models, hostService.Models))
             {
                 Logger.LogVerbose($"Processor {hostService.Processor.Name}, step {buildStep.Name}: Reloading models...");
                 hostService.Reload(models);
             }
         }
     });
 }