Skip to content

Commit

Permalink
Support build using Java 13 and 14
Browse files Browse the repository at this point in the history
- solve error: "As of JDK 13, the com.sun.javadoc API is no longer supported"
- generated `test-javadoc.xml` file moved to sources
- only re-generate this file using `test-javadoc` Maven profile
  • Loading branch information
vojtechhabarta committed Apr 12, 2020
1 parent 935e4d4 commit 33406ca
Show file tree
Hide file tree
Showing 5 changed files with 3,542 additions and 49 deletions.
102 changes: 56 additions & 46 deletions typescript-generator-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,52 +165,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>test-xml-doclet</id>
<phase>process-test-classes</phase>
<goals>
<goal>test-javadoc</goal>
</goals>
<configuration>
<doclet>com.github.markusbernhardt.xmldoclet.XmlDoclet</doclet>
<additionalOptions>-d ${project.build.directory} -filename test-javadoc.xml</additionalOptions>
<useStandardDocletOptions>false</useStandardDocletOptions>
<docletArtifacts>
<docletArtifact>
<groupId>com.github.markusbernhardt</groupId>
<artifactId>xml-doclet</artifactId>
<version>1.0.5</version>
</docletArtifact>
<docletArtifact>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.version}</version>
</docletArtifact>
<docletArtifact>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.version}</version>
</docletArtifact>
<docletArtifact>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${jaxb.version}</version>
</docletArtifact>
<docletArtifact>
<groupId>javax.activation</groupId>
<artifactId>javax.activation-api</artifactId>
<version>${javax.activation.version}</version>
</docletArtifact>
</docletArtifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down Expand Up @@ -241,4 +195,60 @@
</plugins>
</build>

<profiles>
<profile>
<id>test-javadoc</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>test-xml-doclet</id>
<phase>process-test-classes</phase>
<goals>
<goal>test-javadoc</goal>
</goals>
<configuration>
<doclet>com.github.markusbernhardt.xmldoclet.XmlDoclet</doclet>
<additionalOptions>-d ${project.basedir}/src/test/javadoc -filename test-javadoc.xml</additionalOptions>
<useStandardDocletOptions>false</useStandardDocletOptions>
<docletArtifacts>
<docletArtifact>
<groupId>com.github.markusbernhardt</groupId>
<artifactId>xml-doclet</artifactId>
<version>1.0.5</version>
</docletArtifact>
<docletArtifact>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.version}</version>
</docletArtifact>
<docletArtifact>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.version}</version>
</docletArtifact>
<docletArtifact>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${jaxb.version}</version>
</docletArtifact>
<docletArtifact>
<groupId>javax.activation</groupId>
<artifactId>javax.activation-api</artifactId>
<version>${javax.activation.version}</version>
</docletArtifact>
</docletArtifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class JavadocTest {
@Test
public void testJavadoc() {
final Settings settings = TestUtils.settings();
settings.javadocXmlFiles = Arrays.asList(new File("target/test-javadoc.xml"));
settings.javadocXmlFiles = Arrays.asList(new File("src/test/javadoc/test-javadoc.xml"));
final TypeProcessor typeProcessor = new DefaultTypeProcessor();
{
final Model model = new Jackson2Parser(settings, typeProcessor).parseModel(ClassWithJavadoc.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public void testJavadoc() {
final Settings settings = TestUtils.settings();
settings.outputFileType = TypeScriptFileType.implementationFile;
settings.generateJaxrsApplicationInterface = true;
settings.javadocXmlFiles = Arrays.asList(new File("target/test-javadoc.xml"));
settings.javadocXmlFiles = Arrays.asList(new File("src/test/javadoc/test-javadoc.xml"));
final String output = new TypeScriptGenerator(settings).generateTypeScript(Input.from(OrganizationApplication.class));
Assert.assertTrue(output.contains("Returns person with specified ID."));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void testNonConstAnnotationEnum() {
@Test
public void testJavadoc() {
final Settings settings = TestUtils.settings();
settings.javadocXmlFiles = Arrays.asList(new File("target/test-javadoc.xml"));
settings.javadocXmlFiles = Arrays.asList(new File("src/test/javadoc/test-javadoc.xml"));
final String output = new TypeScriptGenerator(settings).generateTypeScript(Input.from(SomeCode.class));
Assert.assertTrue(output.contains("Documentation for SomeCode enum."));
Assert.assertTrue(output.contains("Documentation for VALUE0."));
Expand Down
Loading

0 comments on commit 33406ca

Please sign in to comment.