maven site / javadoc integration
This commit is contained in:
74
pom.xml
74
pom.xml
@@ -16,12 +16,20 @@
|
||||
|
||||
<maven-shade-plugin.version>1.4</maven-shade-plugin.version>
|
||||
<maven-javadoc-plugin.version>2.9</maven-javadoc-plugin.version>
|
||||
<maven-site-plugin.version>3.2</maven-site-plugin.version>
|
||||
|
||||
<finalJarName>TeXDoclet</finalJarName>
|
||||
<texdoclet.version>0.9-SNAPSHOT</texdoclet.version>
|
||||
|
||||
</properties>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The BSD-2-Clause License</name>
|
||||
<url>http://opensource.org/licenses/BSD-2-Clause</url>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>scala-tools</id>
|
||||
@@ -70,8 +78,16 @@
|
||||
<finalName>${finalJarName}</finalName>
|
||||
<sourceDirectory>src/main/java</sourceDirectory>
|
||||
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>${maven-site-plugin.version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
@@ -108,7 +124,7 @@
|
||||
<version>${texdoclet.version}</version>
|
||||
</docletArtifact>
|
||||
<sourcepath>src/main/java:src/test/java</sourcepath>
|
||||
<useStandardDocletOptions>false</useStandardDocletOptions><!-- set to false !!! -->
|
||||
<useStandardDocletOptions>false</useStandardDocletOptions>
|
||||
<destDir>apidocs_tex</destDir>
|
||||
<additionalparam>
|
||||
-tree
|
||||
@@ -123,57 +139,37 @@
|
||||
</additionalparam>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>site</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
</build>
|
||||
|
||||
<!-- goal site:site - alternative TeXDoclet doclet configuration in addition to standard Javadoc doclet -->
|
||||
<reporting>
|
||||
<plugins>
|
||||
|
||||
<!-- Run selective reports - let's build 'about' page only -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
<reports>
|
||||
<report>index</report>
|
||||
</reports>
|
||||
</reportSet>
|
||||
</reportSets>
|
||||
</plugin>
|
||||
|
||||
<!-- goal site:site - alternative TeXDoclet doclet configuration -->
|
||||
<!-- TODO : html docs are not created -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.9</version>
|
||||
<version>${maven-javadoc-plugin.version}</version>
|
||||
<reportSets>
|
||||
|
||||
<reportSet>
|
||||
<id>html</id>
|
||||
<configuration>
|
||||
<destDir>apidocs_html</destDir>
|
||||
</configuration>
|
||||
<reports>
|
||||
<report>javadoc</report>
|
||||
<!--<report>test-javadoc</report>-->
|
||||
</reports>
|
||||
<configuration>
|
||||
<sourcepath>src/main/java:src/test/java</sourcepath>
|
||||
<name>Standard JavaDoc documentation</name>
|
||||
<description>JavaDoc doclet generated API documentation.</description>
|
||||
</configuration>
|
||||
</reportSet>
|
||||
|
||||
</reportSets>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>${maven-javadoc-plugin.version}</version>
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
<id>texdoclet</id>
|
||||
<configuration>
|
||||
@@ -197,17 +193,15 @@
|
||||
-shortinherited
|
||||
</additionalparam>
|
||||
<destDir>apidocs_tex</destDir>
|
||||
<name>TeXDoclet</name>
|
||||
<description>TeXDoclet documentation.</description>
|
||||
<name>TeXDoclet documentation</name>
|
||||
<description>TeXDoclet doclet generated API documentation.</description>
|
||||
</configuration>
|
||||
<reports>
|
||||
<report>javadoc</report>
|
||||
</reports>
|
||||
</reportSet>
|
||||
|
||||
</reportSets>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
|
||||
@@ -250,6 +250,28 @@ public class TeXDoclet extends Doclet {
|
||||
static String introFile = null;
|
||||
static double tableWidthScale = 0.9;
|
||||
static boolean createPdf = false;
|
||||
static final String REPLACE_OUT = "_replace_data_";
|
||||
static final String REPLACE_TITLE = "_replace_title_";
|
||||
static final String HTML_PDF_WRAPPER = "<!DOCTYPE html><html lang=\"en\" xml:lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><head>"
|
||||
+ "<style>"
|
||||
+ "html {"
|
||||
+ " height: 100%;"
|
||||
+ "}"
|
||||
+ "body {"
|
||||
+ " margin: 0px;"
|
||||
+ " height: 100%;"
|
||||
+ " overflow: hidden;"
|
||||
+ "}"
|
||||
+ ".pdfDoc {"
|
||||
+ " height: 100%;"
|
||||
+ " width: 100%;"
|
||||
+ "}"
|
||||
+ "</style>"
|
||||
+ "<title>"
|
||||
+ REPLACE_TITLE
|
||||
+ "</title></head><body><object data=\""
|
||||
+ REPLACE_OUT
|
||||
+ "\" type=\"application/pdf\" class=\"pdfDoc\"></object></body></html>";
|
||||
|
||||
public static void main(String args[]) {
|
||||
|
||||
@@ -2182,6 +2204,7 @@ public class TeXDoclet extends Doclet {
|
||||
|
||||
if (createPdf) {
|
||||
createPdf();
|
||||
createPdfHtmlWrapper();
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
@@ -2202,6 +2225,20 @@ public class TeXDoclet extends Doclet {
|
||||
|
||||
}
|
||||
|
||||
static void createPdfHtmlWrapper() throws IOException {
|
||||
|
||||
String wrapperContent = HTML_PDF_WRAPPER.replace(REPLACE_OUT,
|
||||
outfile.replace(".tex", ".pdf"));
|
||||
wrapperContent = wrapperContent.replace(REPLACE_TITLE,
|
||||
outfile.replace(".tex", ""));
|
||||
|
||||
FileWriter outFile = new FileWriter("index.html");
|
||||
PrintWriter out = new PrintWriter(outFile);
|
||||
out.println(wrapperContent);
|
||||
out.close();
|
||||
|
||||
}
|
||||
|
||||
static int execute(String cmd, String args[], boolean doOutput)
|
||||
throws IOException, InterruptedException {
|
||||
|
||||
|
||||
@@ -4,19 +4,21 @@
|
||||
<title>TeXDoclet</title>
|
||||
</properties>
|
||||
<body>
|
||||
(This is just a test page for the correct generation / integration of Java Doc PDF document)
|
||||
This is a sample maven site project documentation page that demonstrates the TeXDoclet maven integration.
|
||||
<section name="Java Doc - HTML">
|
||||
<ul>
|
||||
<li><a href="apidocs/index.html">link</a> to standard Javadoc
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section name="Java Doc - PDF">
|
||||
<ul>
|
||||
<li><a href="apidocs_tex/TeXDoclet.pdf">link to TeXDoclet.pdf</a>
|
||||
<li><a href="apidocs_tex/TeXDoclet.pdf">link</a> to documentation generated by TeXDoclet
|
||||
</li>
|
||||
<li>embedded PDF file generated by TeXDoclet :
|
||||
</li>
|
||||
</ul>
|
||||
<object data="apidocs_tex/TeXDoclet.pdf" type="application/pdf" width="800px" height="600px"></object>
|
||||
</section>
|
||||
<section name="Java Doc - HTML">
|
||||
<ul>
|
||||
<li><a href="apidocs_html/index.html">link to Html</a>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
Reference in New Issue
Block a user