예제 #1
0
        public void Generate()
        {
            WriteAllText(
                @"Analyzers\Analyzers.xml",
                XmlGenerator.CreateAnalyzersXml());

            WriteAllText(
                @"Analyzers\README.md",
                MarkdownGenerator.CreateAnalyzersReadMe(Analyzers, Comparer));

            WriteAllText(
                @"Analyzers\AnalyzersByCategory.md",
                MarkdownGenerator.CreateAnalyzersByCategoryMarkDown(Analyzers, Comparer));

            WriteAllText(
                @"..\docs\refactorings\Refactorings.md",
                MarkdownGenerator.CreateRefactoringsMarkDown(Refactorings, Comparer));

            WriteAllText(
                @"Refactorings\README.md",
                MarkdownGenerator.CreateRefactoringsReadMe(Refactorings, Comparer));

            foreach (RefactoringDescriptor refactoring in Refactorings)
            {
                WriteAllText(
                    $@"..\docs\refactorings\{refactoring.Identifier}.md",
                    MarkdownGenerator.CreateRefactoringMarkDown(refactoring),
                    fileMustExists: false);
            }

            WriteAllText(
                @"CodeFixes\README.md",
                MarkdownGenerator.CreateCodeFixesReadMe(CodeFixes, CompilerDiagnostics, Comparer));

            WriteAllText(
                @"CodeFixes\CodeFixesByDiagnosticId.md",
                MarkdownGenerator.CreateCodeFixesByDiagnosticId(CodeFixes, CompilerDiagnostics));

            WriteAllText(
                @"..\README.md",
                File.ReadAllText(@"..\text\ReadMe.txt", Encoding.UTF8));

            WriteAllText(
                "DefaultConfigFile.xml",
                XmlGenerator.CreateDefaultConfigFile(Refactorings, CodeFixes));

            WriteAllText(
                @"VisualStudio\description.txt",
                File.ReadAllText(@"..\text\RoslynatorDescription.txt", Encoding.UTF8));

            WriteAllText(
                @"VisualStudio.Refactorings\description.txt",
                File.ReadAllText(@"..\text\RoslynatorRefactoringsDescription.txt", Encoding.UTF8));
        }