Пример #1
0
		private static bool BuildDocumentation (ErrorList errorList)
			{
			ShowConsoleHeader();

			bool rebuildAllOutputFromCommandLine = EngineInstance.Config.RebuildAllOutput;
			bool reparseEverythingFromCommandLine = EngineInstance.Config.ReparseEverything;

			EngineInstance.AddStartupWatcher(new EngineStartupWatcher());


			executionTimer.Start("Engine Startup");
			
			if (EngineInstance.Start(errorList, commandLineConfig) == true)
				{
				executionTimer.End("Engine Startup");


				// File Search
						
				executionTimer.Start("Finding Source Files");

				using ( StatusManagers.FileSearch statusManager = new StatusManagers.FileSearch() )
					{
					statusManager.Start();
							
					Multithread("File Adder", EngineInstance.Files.WorkOnAddingAllFiles);
							
					statusManager.End();
					}
							
				EngineInstance.Files.DeleteFilesNotInFileSources( Engine.Delegates.NeverCancel );
							
				executionTimer.End("Finding Source Files");

						
				// Rebuild notice

				string alternateStartMessage = null;
						
				if (reparseEverythingFromCommandLine || rebuildAllOutputFromCommandLine)
					{  alternateStartMessage = "Status.RebuildEverythingByRequest";  }
				else if (EngineInstance.Config.ReparseEverything && EngineInstance.Config.RebuildAllOutput)
					{  alternateStartMessage = "Status.RebuildEverythingAutomatically";  }
							
							
				// Parsing
						
				executionTimer.Start("Parsing Source Files");

				using ( StatusManagers.Parsing statusManager = new StatusManagers.Parsing(alternateStartMessage) )
					{
					statusManager.Start();
					totalFileChanges = statusManager.TotalFilesToProcess;

					Multithread("Parser", EngineInstance.Files.WorkOnProcessingChanges);							
							
					statusManager.End();
					}
							
				executionTimer.End("Parsing Source Files");

							
				// Resolving
						
				executionTimer.Start("Resolving Links");

				using ( StatusManagers.ResolvingLinks statusManager = new StatusManagers.ResolvingLinks() )
					{
					statusManager.Start();

					Multithread("Resolver", EngineInstance.Links.WorkOnResolvingLinks);
							
					statusManager.End();
					}
							
				executionTimer.End("Resolving Links");

							
				// Building
						
				executionTimer.Start("Building Output");

				using ( StatusManagers.Building statusManager = new StatusManagers.Building() )
					{
					statusManager.Start();

					Multithread("Builder", EngineInstance.Output.WorkOnUpdatingOutput);
					Multithread("Finalizer", EngineInstance.Output.WorkOnFinalizingOutput);							
							
					statusManager.End();
					}
							
				executionTimer.End("Building Output");

							
				// End
						
				EngineInstance.Cleanup(Delegates.NeverCancel);
						
				ShowConsoleFooter(true);
				return true;
				}

			else // engine did not start correctly
				{  
				executionTimer.End("Engine Startup");

				ShowConsoleFooter(false);
				return false;
				}
			}
Пример #2
0
        private static bool BuildDocumentation(ErrorList errorList)
        {
            ShowConsoleHeader();

            EngineInstance.AddStartupWatcher(new EngineStartupWatcher());


            executionTimer.Start("Engine Startup");

            if (EngineInstance.Start(errorList, commandLineConfig) == true)
            {
                executionTimer.End("Engine Startup");


                // File Search

                executionTimer.Start("Finding Source Files");

                var adderProcess = EngineInstance.Files.CreateAdderProcess();

                using (StatusManagers.FileSearch statusManager = new StatusManagers.FileSearch(adderProcess))
                {
                    statusManager.Start();

                    Multithread("File Adder", adderProcess.WorkOnAddingAllFiles);

                    statusManager.End();
                }

                EngineInstance.Files.DeleteFilesNotReAdded(Engine.Delegates.NeverCancel);
                adderProcess.Dispose();

                executionTimer.End("Finding Source Files");


                // Rebuild notice

                string alternativeStartMessage = null;

                if (EngineInstance.Config.UserWantsEverythingRebuilt ||
                    EngineInstance.Config.UserWantsOutputRebuilt)
                {
                    alternativeStartMessage = "Status.RebuildEverythingByRequest";
                }
                else if (EngineInstance.HasIssues(StartupIssues.NeedToStartFresh |
                                                  StartupIssues.NeedToReparseAllFiles |
                                                  StartupIssues.NeedToRebuildAllOutput))
                {
                    alternativeStartMessage = "Status.RebuildEverythingAutomatically";
                }


                // Parsing

                executionTimer.Start("Parsing Source Files");

                var changeProcessor = EngineInstance.Files.CreateChangeProcessor();

                using (StatusManagers.Parsing statusManager = new StatusManagers.Parsing(changeProcessor, alternativeStartMessage))
                {
                    statusManager.Start();
                    totalFileChanges = statusManager.TotalFilesToProcess;

                    Multithread("Parser", changeProcessor.WorkOnProcessingChanges);

                    statusManager.End();
                }

                changeProcessor.Dispose();

                executionTimer.End("Parsing Source Files");


                // Resolving

                executionTimer.Start("Resolving Links");

                var resolverProcess = EngineInstance.Links.CreateResolverProcess();

                using (StatusManagers.ResolvingLinks statusManager = new StatusManagers.ResolvingLinks(resolverProcess))
                {
                    statusManager.Start();

                    Multithread("Resolver", resolverProcess.WorkOnResolvingLinks);

                    statusManager.End();
                }

                resolverProcess.Dispose();

                executionTimer.End("Resolving Links");


                // Building

                executionTimer.Start("Building Output");

                var builderProcess = EngineInstance.Output.CreateBuilderProcess();

                using (StatusManagers.Building statusManager = new StatusManagers.Building(builderProcess))
                {
                    statusManager.Start();

                    Multithread("Builder", builderProcess.WorkOnUpdatingOutput);
                    Multithread("Finalizer", builderProcess.WorkOnFinalizingOutput);

                    statusManager.End();
                }

                builderProcess.Dispose();

                executionTimer.End("Building Output");


                // End

                EngineInstance.Cleanup(Delegates.NeverCancel);

                ShowConsoleFooter(true);
                return(true);
            }

            else             // engine did not start correctly
            {
                executionTimer.End("Engine Startup");

                ShowConsoleFooter(false);
                return(false);
            }
        }