Skip to content

Commit

Permalink
Skeleton for doclet and testing modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaroslav Tulach committed Dec 29, 2015
1 parent b1fb3cf commit 16fd9cf
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 0 deletions.
24 changes: 24 additions & 0 deletions doclet/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apidesign.javadoc</groupId>
<artifactId>pom</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>doclet</artifactId>
<name>Codesnippet Doclet Code</name>
<properties>
<tools.jar>${java.home}/../lib/tools.jar</tools.jar>
</properties>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.oracle.java</groupId>
<artifactId>tools</artifactId>
<version>1.7</version>
<scope>system</scope>
<systemPath>${tools.jar}</systemPath>
</dependency>
</dependencies>
</project>
45 changes: 45 additions & 0 deletions doclet/src/main/java/org/apidesign/javadoc/codesnippet/Doclet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Codesnippet Javadoc Doclet
* Copyright (C) 2015-2016 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.0 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://opensource.org/licenses/GPL-3.0.
*/
package org.apidesign.javadoc.codesnippet;

import com.sun.javadoc.DocErrorReporter;
import com.sun.javadoc.LanguageVersion;
import com.sun.javadoc.RootDoc;
import com.sun.tools.doclets.formats.html.HtmlDoclet;

public final class Doclet {
private Doclet() {
}
public static boolean start(RootDoc root) {
return HtmlDoclet.start(root);
}

public static int optionLength(String option) {
return HtmlDoclet.optionLength(option);
}

public static boolean validOptions(String[][] options,
DocErrorReporter reporter) {
return HtmlDoclet.validOptions(options, reporter);
}

public static LanguageVersion languageVersion() {
return HtmlDoclet.languageVersion();
}

}
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<artifactId>pom</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Codesnippet Javadoc Doclet</name>
<parent>
<groupId>net.java</groupId>
<artifactId>jvnet-parent</artifactId>
Expand Down Expand Up @@ -102,6 +103,10 @@
</plugins>
</pluginManagement>
</build>
<modules>
<module>doclet</module>
<module>testing</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
Expand Down
36 changes: 36 additions & 0 deletions testing/nbactions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Codesnippet Javadoc Doclet
Copyright (C) 2015-2016 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.0 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. Look for COPYING file in the top folder.
If not, see http://opensource.org/licenses/GPL-3.0.
-->
<actions>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>javadoc:javadoc</goal>
</goals>
<properties>
<jpda.listen>true</jpda.listen>
<debug>-J-Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address}</debug>
</properties>
</action>
</actions>
40 changes: 40 additions & 0 deletions testing/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apidesign.javadoc</groupId>
<artifactId>pom</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>testing</artifactId>
<packaging>jar</packaging>
<properties>
<debug></debug>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<doclet>org.apidesign.javadoc.codesnippet.Doclet</doclet>
<docletArtifact>
<groupId>${project.groupId}</groupId>
<artifactId>doclet</artifactId>
<version>1.0-SNAPSHOT</version>
</docletArtifact>
<additionalJOption>${debug}</additionalJOption>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
<type>jar</type>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Codesnippet Javadoc Doclet
* Copyright (C) 2015-2016 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.0 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://opensource.org/licenses/GPL-3.0.
*/
package org.apidesign.javadoc.testing;

/** My sample class.
*/
public class SampleClass {
private SampleClass() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Codesnippet Javadoc Doclet
* Copyright (C) 2015-2016 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.0 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://opensource.org/licenses/GPL-3.0.
*/
package org.apidesign.javadoc.testing;

import static org.testng.Assert.fail;
import org.testng.annotations.Test;

public class VerifyJavadocTest {

public VerifyJavadocTest() {
}

@Test
public void testSomeMethod() {
fail("The test case is a prototype.");
}

}

0 comments on commit 16fd9cf

Please sign in to comment.