Example #1
0
        public static int Main(string[] args)
        {
#if DEBUG
            Report.SetDebugProfile();
#endif

#if !DEBUG
            AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionTrapper;
            Report.SetReleaseProfile();
#endif

            TotalStopwatch.Restart();
            StageStopwatch.Restart();
            var options = new Options();
            GetCommandLineOptions(args, options);
            GetOptions(options.ProjectFilePath ?? EnvVar.DefaultInfoPath, options);
            Report.Verbose = options.Verbose;
            SaveTiming("options-parsing", StageStopwatch.ElapsedMilliseconds);

            var project = GetProject(options.SourceFilePaths, options.RunInSerial);

            var xmlOutputter = GetXmlOutputter(project, new XElement("Information", options.XmlInformation));
            if (options.SaveXmls)
            {
                xmlOutputter.SaveToDisk(EnvVar.XmlOutputPath(options.OutputDirectory, "project.xml"));
            }

            if (options.NoOutput)
            {
                return(0);
            }

            OutputTheme(options);
            OutputHtml(project, xmlOutputter, options);

            SaveTiming("total", TotalStopwatch.ElapsedMilliseconds);
            if (options.TimeOutput)
            {
                Directory.CreateDirectory(EnvVar.XmlOutputPath(options.OutputDirectory));
                TimingXml.Save(EnvVar.XmlOutputPath(options.OutputDirectory, "timings.xml"));
            }

            Report.NewStatus($@"Documentation can be found at '{Path.GetFullPath(options.OutputDirectory)}'");
            Report.NewStatus("Documentation generation complete.\n");
            return(0);
        }
Example #2
0
 private static void SaveTiming(string name, long milliseonds)
 {
     TimingXml.Add(new XElement(name, milliseonds));
 }