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-shade-plugin.version>1.4</maven-shade-plugin.version>
|
||||||
<maven-javadoc-plugin.version>2.9</maven-javadoc-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>
|
<finalJarName>TeXDoclet</finalJarName>
|
||||||
<texdoclet.version>0.9-SNAPSHOT</texdoclet.version>
|
<texdoclet.version>0.9-SNAPSHOT</texdoclet.version>
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<licenses>
|
||||||
|
<license>
|
||||||
|
<name>The BSD-2-Clause License</name>
|
||||||
|
<url>http://opensource.org/licenses/BSD-2-Clause</url>
|
||||||
|
</license>
|
||||||
|
</licenses>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>scala-tools</id>
|
<id>scala-tools</id>
|
||||||
@@ -70,8 +78,16 @@
|
|||||||
<finalName>${finalJarName}</finalName>
|
<finalName>${finalJarName}</finalName>
|
||||||
<sourceDirectory>src/main/java</sourceDirectory>
|
<sourceDirectory>src/main/java</sourceDirectory>
|
||||||
|
|
||||||
|
<pluginManagement>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
|
<version>${maven-site-plugin.version}</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
@@ -108,7 +124,7 @@
|
|||||||
<version>${texdoclet.version}</version>
|
<version>${texdoclet.version}</version>
|
||||||
</docletArtifact>
|
</docletArtifact>
|
||||||
<sourcepath>src/main/java:src/test/java</sourcepath>
|
<sourcepath>src/main/java:src/test/java</sourcepath>
|
||||||
<useStandardDocletOptions>false</useStandardDocletOptions><!-- set to false !!! -->
|
<useStandardDocletOptions>false</useStandardDocletOptions>
|
||||||
<destDir>apidocs_tex</destDir>
|
<destDir>apidocs_tex</destDir>
|
||||||
<additionalparam>
|
<additionalparam>
|
||||||
-tree
|
-tree
|
||||||
@@ -123,57 +139,37 @@
|
|||||||
</additionalparam>
|
</additionalparam>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</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>
|
</plugins>
|
||||||
|
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
<!-- goal site:site - alternative TeXDoclet doclet configuration in addition to standard Javadoc doclet -->
|
||||||
<reporting>
|
<reporting>
|
||||||
<plugins>
|
<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>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>2.9</version>
|
<version>${maven-javadoc-plugin.version}</version>
|
||||||
<reportSets>
|
<reportSets>
|
||||||
|
|
||||||
<reportSet>
|
<reportSet>
|
||||||
<id>html</id>
|
<id>html</id>
|
||||||
<configuration>
|
|
||||||
<destDir>apidocs_html</destDir>
|
|
||||||
</configuration>
|
|
||||||
<reports>
|
<reports>
|
||||||
<report>javadoc</report>
|
<report>javadoc</report>
|
||||||
|
<!--<report>test-javadoc</report>-->
|
||||||
</reports>
|
</reports>
|
||||||
|
<configuration>
|
||||||
|
<sourcepath>src/main/java:src/test/java</sourcepath>
|
||||||
|
<name>Standard JavaDoc documentation</name>
|
||||||
|
<description>JavaDoc doclet generated API documentation.</description>
|
||||||
|
</configuration>
|
||||||
</reportSet>
|
</reportSet>
|
||||||
|
</reportSets>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<version>${maven-javadoc-plugin.version}</version>
|
||||||
|
<reportSets>
|
||||||
<reportSet>
|
<reportSet>
|
||||||
<id>texdoclet</id>
|
<id>texdoclet</id>
|
||||||
<configuration>
|
<configuration>
|
||||||
@@ -197,17 +193,15 @@
|
|||||||
-shortinherited
|
-shortinherited
|
||||||
</additionalparam>
|
</additionalparam>
|
||||||
<destDir>apidocs_tex</destDir>
|
<destDir>apidocs_tex</destDir>
|
||||||
<name>TeXDoclet</name>
|
<name>TeXDoclet documentation</name>
|
||||||
<description>TeXDoclet documentation.</description>
|
<description>TeXDoclet doclet generated API documentation.</description>
|
||||||
</configuration>
|
</configuration>
|
||||||
<reports>
|
<reports>
|
||||||
<report>javadoc</report>
|
<report>javadoc</report>
|
||||||
</reports>
|
</reports>
|
||||||
</reportSet>
|
</reportSet>
|
||||||
|
|
||||||
</reportSets>
|
</reportSets>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</reporting>
|
</reporting>
|
||||||
|
|
||||||
|
|||||||
@@ -250,6 +250,28 @@ public class TeXDoclet extends Doclet {
|
|||||||
static String introFile = null;
|
static String introFile = null;
|
||||||
static double tableWidthScale = 0.9;
|
static double tableWidthScale = 0.9;
|
||||||
static boolean createPdf = false;
|
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[]) {
|
public static void main(String args[]) {
|
||||||
|
|
||||||
@@ -2182,6 +2204,7 @@ public class TeXDoclet extends Doclet {
|
|||||||
|
|
||||||
if (createPdf) {
|
if (createPdf) {
|
||||||
createPdf();
|
createPdf();
|
||||||
|
createPdfHtmlWrapper();
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} 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)
|
static int execute(String cmd, String args[], boolean doOutput)
|
||||||
throws IOException, InterruptedException {
|
throws IOException, InterruptedException {
|
||||||
|
|
||||||
|
|||||||
@@ -4,19 +4,21 @@
|
|||||||
<title>TeXDoclet</title>
|
<title>TeXDoclet</title>
|
||||||
</properties>
|
</properties>
|
||||||
<body>
|
<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">
|
<section name="Java Doc - PDF">
|
||||||
<ul>
|
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<object data="apidocs_tex/TeXDoclet.pdf" type="application/pdf" width="800px" height="600px"></object>
|
<object data="apidocs_tex/TeXDoclet.pdf" type="application/pdf" width="800px" height="600px"></object>
|
||||||
</section>
|
</section>
|
||||||
<section name="Java Doc - HTML">
|
|
||||||
<ul>
|
|
||||||
<li><a href="apidocs_html/index.html">link to Html</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</section>
|
|
||||||
</body>
|
</body>
|
||||||
</document>
|
</document>
|
||||||
Reference in New Issue
Block a user