-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skeleton for doclet and testing modules
- Loading branch information
Jaroslav Tulach
committed
Dec 29, 2015
1 parent
b1fb3cf
commit 16fd9cf
Showing
7 changed files
with
208 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
45
doclet/src/main/java/org/apidesign/javadoc/codesnippet/Doclet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
25 changes: 25 additions & 0 deletions
25
testing/src/main/java/org/apidesign/javadoc/testing/SampleClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
testing/src/test/java/org/apidesign/javadoc/testing/VerifyJavadocTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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."); | ||
} | ||
|
||
} |