WIP: Generate documentation

(Manual run with `mvn exec:java@generate-bugpattern-docs -pl refaster-runner`.)

TODO: Actually hook this up in a website
This commit is contained in:
Stephan Schroevers
2018-04-28 19:34:04 +02:00
parent feb9abfa91
commit f9910160c7
3 changed files with 58 additions and 0 deletions

View File

@@ -242,5 +242,11 @@
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

36
pom.xml
View File

@@ -810,6 +810,11 @@
<artifactId>error_prone_core</artifactId>
<version>${version.error-prone}</version>
</path>
<path>
<groupId>${groupId.error-prone}</groupId>
<artifactId>error_prone_docgen_processor</artifactId>
<version>${version.error-prone}</version>
</path>
<path>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
@@ -1089,6 +1094,37 @@
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<mainClass>com.google.errorprone.DocGenTool</mainClass>
<arguments>
<argument>-bug_patterns=${project.build.directory}/generated-sources/annotations/bugPatterns.txt</argument>
<argument>-docs_repository=${project.build.directory}/generated-wiki/</argument>
<argument>-explanations=${basedir}/src/main/docs/bugpattern/</argument>
<argument>-target=external</argument>
</arguments>
<includePluginDependencies>true</includePluginDependencies>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_docgen</artifactId>
<version>${version.error-prone}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-bugpattern-docs</id>
<goals>
<goal>java</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>

View File

@@ -0,0 +1,16 @@
Error Prone's out-of-the-box support for the application of
[Refaster][refaster] templates is somewhat cumbersome. Additionally, by default
the focus of Refaster templates is on one-off code refactorings.
This plugin attempts to bring Refaster templates on equal footing with other
Error Prone plugins by locating all Refaster templates on the classpath and
reporing any match. The suggested changes can be applied using Error Prone's
built-in [patch][patching] functionality.
XXX: Expand documentation. Mention:
- The `refaster-resource-compiler`.
- How checks can be restricted using the `NamePattern` flag (see the Javadoc)
- An concrete patching example, with and without `NamePattern`.
[refaster]: https://errorprone.info/docs/refaster
[patching]: https://errorprone.info/docs/patching