Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Devsite Javadoc profile #121

Merged
merged 5 commits into from
Apr 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -572,5 +572,100 @@
<skipITs>false</skipITs>
</properties>
</profile>
<profile>
<id>devsite-apidocs</id>
<activation>
<property>
<!-- Activate with the -Ddevsite.template=/path/to/templates flag. -->
<name>devsite.template</name>
BenWhitehead marked this conversation as resolved.
Show resolved Hide resolved
</property>
</activation>
<build>
<plugins>
<plugin>
<!-- Generate API docs using Doclava for the developer site. -->
<artifactId>maven-javadoc-plugin</artifactId>
<!-- Note: version 3.x.x uses additionalOption instead of additionalparam. -->
<version>3.1.1</version>
<executions>
<execution>
<phase>site</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
<configuration>
<docletArtifact>
<groupId>com.google.doclava</groupId>
<artifactId>doclava</artifactId>
<version>1.0.6</version>
</docletArtifact>
<doclet>com.google.doclava.Doclava</doclet>
<bootclasspath>${sun.boot.class.path}</bootclasspath>
<additionalDependencies>
<additionalDependency>
<groupId>com.google.j2objc</groupId>
<artifactId>j2objc-annotations</artifactId>
<version>1.3</version>
</additionalDependency>
</additionalDependencies>
<additionalOptions>
<additionalOption>-hdf</additionalOption>
<additionalOption>book.path</additionalOption>
<additionalOption>/java/_book.yaml</additionalOption>
<additionalOption>-hdf</additionalOption>
<additionalOption>project.path</additionalOption>
<additionalOption>/java/_project.yaml</additionalOption>
<additionalOption>-hdf</additionalOption>
<additionalOption>devsite.path</additionalOption>
<additionalOption>/java/reference/</additionalOption>
<additionalOption>-d</additionalOption>
<additionalOption>${project.build.directory}/devsite</additionalOption>
<additionalOption>-templatedir</additionalOption>
<additionalOption>${devsite.template}</additionalOption>
<additionalOption>-toroot</additionalOption>
<additionalOption>/java/reference/</additionalOption>
<additionalOption>-yaml</additionalOption>
<additionalOption>_toc.yaml</additionalOption>
<additionalOption>-warning</additionalOption>
<additionalOption>101</additionalOption>
</additionalOptions>
<useStandardDocletOptions>false</useStandardDocletOptions>
</configuration>
</plugin>
<plugin>
<!-- Clean up some references and files. -->
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>site</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo message="Updating relative links in API docs" />
<!-- TODO: What is the right behavior for io* and google*? -->
<replace dir="${project.build.directory}/devsite" token="href=&quot;com" value="href=&quot;/java/reference/com" />
<replace dir="${project.build.directory}/devsite" token="href=&quot;io" value="href=&quot;/java/reference/io" />
<replace dir="${project.build.directory}/devsite" token="href=&quot;google" value="href=&quot;/java/reference/google" />
<copy file="${project.build.directory}/devsite/assets/_toc.yaml" todir="${project.build.directory}/devsite/reference" />
<echo message="Removing files not needed by Devsite" />
<delete file="${project.build.directory}/devsite/reference/classes.html" />
<delete file="${project.build.directory}/devsite/reference/hierarchy.html" />
<delete file="${project.build.directory}/devsite/reference/index.html" />
<delete file="${project.build.directory}/devsite/reference/lists.js" />
<delete file="${project.build.directory}/devsite/reference/packages.html" />
<delete file="${project.build.directory}/devsite/reference/current.xml" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>